Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

$urltopic

Recommended Posts

  • Administrators

Returns the topic from an URL (doesn't convert special chars like ä or ß etc.)

 

Requires the $download() Snippet

 

> alias urltopic {!var %rif ($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 = $ifmatchif ($regex(%I,<title>(.*)</title>)) {%r = $regml(1)}}elseif ($read(tmpfile,nw,*<title>*)) {!var %I = $ifmatch!var %- = $regex(%I,<title>(.*))%r = $regml(1)%I = 100while (*</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}
Link to comment
Share on other sites



×
×
  • Create New...