egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

timer

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
FcLan
Halfop


Joined: 30 Sep 2005
Posts: 64
Location: Poland

PostPosted: Tue Dec 26, 2006 10:53 am    Post subject: timer Reply with quote

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">&nbsp;: <b>(.*?)</b> (.*?)&nbsp;</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
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Tue Dec 26, 2006 11:10 am    Post subject: Reply with quote

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">&nbsp;: <b>(.*?)</b> (.*?)&nbsp;</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
View user's profile Send private message Send e-mail Visit poster's website
FcLan
Halfop


Joined: 30 Sep 2005
Posts: 64
Location: Poland

PostPosted: Tue Dec 26, 2006 3:48 pm    Post subject: Reply with quote

Code:
[19:44] wrong # args: should be "www:news1 nick host handle chan text"


Sad
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Tue Dec 26, 2006 4:30 pm    Post subject: Reply with quote

What is www:news1 from you error msg?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FcLan
Halfop


Joined: 30 Sep 2005
Posts: 64
Location: Poland

PostPosted: Wed Dec 27, 2006 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Wed Dec 27, 2006 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FcLan
Halfop


Joined: 30 Sep 2005
Posts: 64
Location: Poland

PostPosted: Wed Dec 27, 2006 12:35 pm    Post subject: Reply with quote

Yes, but how to do it.. I don`t know how to use it, it`s only an example
Back to top
View user's profile Send private message
FcLan
Halfop


Joined: 30 Sep 2005
Posts: 64
Location: Poland

PostPosted: Wed Dec 27, 2006 4:58 pm    Post subject: Reply with quote

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">&nbsp;: <b>(.*?)</b> (.*?)&nbsp;</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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber