This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Need "sockets" help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
R
Red_Rooste5
Voice
Posts: 37
Joined: Sat Oct 21, 2006 7:43 am

Need "sockets" help

Post by Red_Rooste5 »

i'm having some problems with this script:

Code: Select all

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?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

You tell us.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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 =)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
Post Reply