| View previous topic :: View next topic |
| Author |
Message |
Red_Rooste5 Voice
Joined: 21 Oct 2006 Posts: 37
|
Posted: Thu Oct 26, 2006 2:12 pm Post subject: Need "sockets" help |
|
|
i'm having some problems with this script:
| Code: | bind pub - @rsnews rsnew:proc
proc rsnew:rsnews {nick uhost hand chan text} {
set site "http://www.slushpuppy.silverinterlocution.org/parsers/rsnews.php"
set token [::http::geturl $site]
set content [::http::data $token]
::http::cleanup $content
}
regexp {<br>(.*?)</br>} $content - rsnews
putserv "PRIVMSG $chan :[RSNEWS] $rsnews"
}
}
|
What's wrong with it? |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Oct 26, 2006 3:20 pm Post subject: |
|
|
| You tell us. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Oct 26, 2006 9:14 pm Post subject: |
|
|
Well, one mistake I see is you want to use ::http::cleanup on the page, not the content, so it should say
::http::cleanup $token
But I don't think cleanup would clobber the $content variable, but maybe it does..
As far as your regexp, I don't think "-" will work as a variablename, so change it to something else, like
regexp {<br>(.*?)</br>} $content match rsnews
"match" is the entire string that matched, and $rsnews is the part that was within () (but you seem to know that already =) |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Oct 27, 2006 9:02 am Post subject: |
|
|
You got 1 (one) opened '{' and 3 (three) closed '}' while you should have just 1 (one) pair of them. Fix that first, and then browse tough the forum and find some of the topics related to this. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|