It is currently 9. April 2020 18:48

All times are UTC + 1 hour




 Page 1 of 1 [ 1 post ] 
Author Message
 Post subject: $urltopic
PostPosted: 23. November 2009 23:18 
Administrator
User avatar

Joined: 17. March 2008 13:32
Posts: 96
Location: Arnstadt, Germany
Returns the topic from an URL (doesn't convert special chars like ä or ß etc.)

Requires the $download() Snippet
alias urltopic {
  !var %r
  if ($download(tmpfile,HEAD,$replace($1-,$chr(32),$chr(44)),1)) && ($read(tmpfile,nw,Content-Type: *html*)) && ($download(tmpfile,GET,$replace($1-,$chr(32),$chr(44)),2)) {
    if ($read(tmpfile,nw,*<title>*</title>*)) {
      !var %I = $ifmatch
      if ($regex(%I,<title>(.*)</title>)) {
        %r = $regml(1)
      }
    }
    elseif ($read(tmpfile,nw,*<title>*)) {
      !var %I = $ifmatch
      !var %- = $regex(%I,<title>(.*))
      %r = $regml(1)
      %I = 100
      while (*</title>* !iswm $read(tmpfile,n,$calc($readn +1)) && %I) {
        %r = %r $v2
        !dec %I
      }
      %- = $regex($read(tmpfile,n,$readn),(.*)</title>)
      %r = %r $regml(1)
    }
  }
  if ($isfile(tmpfile)) { !.remove tmpfile }
  %r = $remove(%r,$chr(9))
  if ($len(%r)) { !return %r }
  :error
  !reseterror
  !return $false
}



_________________
one step closer to world domination
Cyberscripters Administrator/Founder
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron