| View previous topic :: View next topic |
| Author |
Message |
kerum Voice
Joined: 11 Jan 2013 Posts: 8
|
Posted: Fri Jan 11, 2013 10:10 am Post subject: Connect to website and retrieve a line of text |
|
|
Hello everyone. I need a script for eggdrop that will let me make eggdrop go to a website and retrieve the text from it.
The website is a simple PHP script that echoes only one line of text. Now, I would like eggdrop to go there and write back that line of text in the IRC channel. It would look like this:
Thank you. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jan 11, 2013 12:23 pm Post subject: |
|
|
| Code: |
bind pub - !webreq my:webreq
proc my:webreq {nick uhost hand chan text} {
if {[scan $text {%s} url] != 1} {
puthelp "NOTICE $nick :Error, correct syntax is: !webreq <url>"
return
}
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
foreach line [split $content \n] {
puthelp "PRIVMSG $chan :$line"
}
}
|
Here's something simple that should do what you need. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
kerum Voice
Joined: 11 Jan 2013 Posts: 8
|
Posted: Fri Jan 11, 2013 12:31 pm Post subject: |
|
|
Thanks. I'll test it now.
I'm a newbie to all this... I put that code into web.tcl, right?
EDIT: Thank you!!! It works perfectly Thanks again! |
|
| Back to top |
|
 |
Dominatez Halfop

Joined: 14 Jan 2019 Posts: 46 Location: United Kingdom
|
Posted: Fri Aug 16, 2019 6:05 pm Post subject: |
|
|
| Is there any chance you could get this working again Caeser ? |
|
| Back to top |
|
 |
Dominatez Halfop

Joined: 14 Jan 2019 Posts: 46 Location: United Kingdom
|
Posted: Fri Aug 16, 2019 8:34 pm Post subject: |
|
|
Ok. Odd. When you pop in https://www.websitename.com
It start's spewing out the pages entire source code. |
|
| Back to top |
|
 |
|