| View previous topic :: View next topic |
| Author |
Message |
FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Tue Dec 26, 2006 10:53 am Post subject: timer |
|
|
Timer, how to send last post to channel very 30 minutes
pls just help me with timer.. thx
| Code: | package require http
bind pub - !forum www:news
proc www:news {nick host handle chan text} {
set data [http::data [http::geturl http://someurl.com]]
regexp {</a> / <b><a href="(.*?)">(.*?)</a></b></div>} $data data match lik
puthelp "PRIVMSG $chan :Ostatni post na forum: \002$lik\002 - $match"
set data [http::data [http::geturl http://someurl.com]]
regexp {<div align="right"> : <b>(.*?)</b> (.*?) </div>} $data data czas godzina
puthelp "PRIVMSG $chan :Wyslany $czas $godzina"
set data [http::data [http::geturl http://someurl]]
regexp {Nowe: wysłane przez <a href="(.*?)">(.*?)</a> </span>} $data data user2 user
puthelp "PRIVMSG $chan :Autor: \002$user"
} |
|
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Tue Dec 26, 2006 11:10 am Post subject: |
|
|
Hope itll work.
| Code: | package require http
set chan "#yourchannel"
#here we start our timer
timer 30 www:news
proc www:news { } {
set data [http::data [http::geturl http://someurl.com]]
regexp {</a> / <b><a href="(.*?)">(.*?)</a></b></div>} $data data match lik
puthelp "PRIVMSG $chan :Ostatni post na forum: \002$lik\002 - $match"
set data [http::data [http::geturl http://someurl.com]]
regexp {<div align="right"> : <b>(.*?)</b> (.*?) </div>} $data data czas godzina
puthelp "PRIVMSG $chan :Wyslany $czas $godzina"
set data [http::data [http::geturl http://someurl]]
regexp {Nowe: wysłane przez <a href="(.*?)">(.*?)</a> </span>} $data data user2 user
puthelp "PRIVMSG $chan :Autor: \002$user"
#and one more timer to cycle www:news proc
timer 30 www:news
} |
|
|
| Back to top |
|
 |
FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Tue Dec 26, 2006 3:48 pm Post subject: |
|
|
| Code: | | [19:44] wrong # args: should be "www:news1 nick host handle chan text" |
 |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Tue Dec 26, 2006 4:30 pm Post subject: |
|
|
| What is www:news1 from you error msg? |
|
| Back to top |
|
 |
FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Wed Dec 27, 2006 6:16 am Post subject: |
|
|
Ok, I fixed it ;p, but another thing for example I vae a site with:
| Code: | club 2:2 club2
club 5:2 club3 |
And I want to show it at irc with my script it works only with frist line, second not.. I don`t know how to do it |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Wed Dec 27, 2006 11:08 am Post subject: |
|
|
| FcLan wrote: | Ok, I fixed it ;p, but another thing for example I vae a site with:
| Code: | club 2:2 club2
club 5:2 club3 |
And I want to show it at irc with my script it works only with frist line, second not.. I don`t know how to do it |
I dont understand you, you want to post this lines to IRC useing regexp? If so youd better post here html code with this lines. |
|
| Back to top |
|
 |
FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Wed Dec 27, 2006 12:35 pm Post subject: |
|
|
| Yes, but how to do it.. I don`t know how to use it, it`s only an example |
|
| Back to top |
|
 |
FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Wed Dec 27, 2006 4:58 pm Post subject: |
|
|
it`s again me .. I try to sue regsub for replace some stupid text to polish letter but it does not work: i mean this line o the code:
regsub -all "¦" $match "s" match
set chan "#yourchannel"
#here we start our timer
timer 30 www:news
| Code: | proc www:news { } {
set data [http::data [http::geturl http://someurl.com]]
regexp {</a> / <b><a href="(.*?)">(.*?)</a></b></div>} $data data match lik
regsub -all "¦" $match "s" match
puthelp "PRIVMSG $chan :Ostatni post na forum: \002$lik\002 - $match"
set data [http::data [http::geturl http://someurl.com]]
regexp {<div align="right"> : <b>(.*?)</b> (.*?) </div>} $data data czas godzina
puthelp "PRIVMSG $chan :Wyslany $czas $godzina"
set data [http::data [http::geturl http://someurl]]
regexp {Nowe: wysłane przez <a href="(.*?)">(.*?)</a> </span>} $data data user2 user
puthelp "PRIVMSG $chan :Autor: \002$user"
#and one more timer to cycle www:news proc
timer 30 www:news
} |
|
|
| Back to top |
|
 |
|