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.

eggy reading an webpage

Old posts that have not been replied to for several years.
Locked
a
ahv

eggy reading an webpage

Post by ahv »

Hi

Does anybody know of a tcl script that reads the info from a webpage and puts it in a channel or file?

regards,

ahv
j
jagg

Post by jagg »

Wcc has posted few topics ago:

Code: Select all

package require http 
bind pub o|o !test pub:titre 

proc getsong_get {url} { 
  if {[catch {set tok [::http::geturl $url]} error]} { 
    return "An error occurred while connecting to $url." 
  } 
  set data [::http::data $tok] 
  ::http::cleanup $tok 
  return $data 
} 

proc pub:titre {nick uhost hand chan text} { 
  puthelp "NOTICE $nick :[getsong_get http://fulgore.goyman.com/~zone80/titre.php]" 
} 
This reads the song title from http://fulgore.goyman.com/~zone80/titre.php and message it to the channel. It works fine, but on the titre.php site in the source code there stands only the song title, nothing else (no <html> etc. at the beginning)!!!

I tried this code with a "normal" html-page which begins with <html> and so on.... The Bot only display

"<Bot> - <html>"

in the channel then it stops ( I think because of the line break!?).

So, how do I have to change the code above that I get more than only <html>?

P.S.: How can I search the source code first so that the bot doesnt post the code from beginning (<html>....), so that the bot only prints text eg which stands between <b></b> (eg <b>Text Text Text</b>)!!?
a
ahv

constantly updated

Post by ahv »

well this page is a page that has info about an online game, and is constantly updated (every minute).

How can i get the bot to read all the info, and post only the latest news into the channel, as the old info stays on the page also for 24 hours

ahv
g
g!zMo

Post by g!zMo »

jagg wrote: P.S.: How can I search the source code first so that the bot doesnt post the code from beginning (<html>....), so that the bot only prints text eg which stands between <b></b> (eg <b>Text Text Text</b>)!!?
Yeah this is exactly what I'm searching for...
Locked