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.

timer

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

timer

Post by FcLan »

Timer, how to send last post to channel very 30 minutes
pls just help me with timer.. thx

Code: Select all

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"
}
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Hope itll work.

Code: Select all

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
}
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

Code: Select all

[19:44] wrong # args: should be "www:news1 nick host handle chan text"
:(
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

What is www:news1 from you error msg?
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

Ok, I fixed it ;p, but another thing for example I vae a site with:

Code: Select all

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
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

FcLan wrote:Ok, I fixed it ;p, but another thing for example I vae a site with:

Code: Select all

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.
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

Yes, but how to do it.. I don`t know how to use it, it`s only an example
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

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: Select all

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