; torrent rss reader v2
; LtGuide (ltguide xscripters.com)
; 11 January 2006
; msg channel
alias -l rss.chan return #torrent
; site to connect to
alias -l rss.site return www.somesite.com
; file you want to retrieve
alias -l rss.page return torrents/rss.php
; notifies of update to rss
; (1 for on, 0 for off)
alias -l rss.achk return 0
; displays X chars of description
; (integer >0 for on, 0 for off)
alias -l rss.desc return 50
; you can trigger the auto check (msgs if there is a new update) with /rss #chan 0
; or you can send the last two updates with /rss #chan 2
on $*:text:/^!rss( [1-5])?$/:#:{
if (!%rss_spam) && ($chan == $rss.chan) {
set -u10 %rss_spam 1
rss $chan $2
}
}
on me:*:join:#:{
if ($chan == $rss.chan) && ($rss.achk) rss $rss.chan 0
}
on *:unload:{ unset %rss_latest %rss_desc }
on *:sockopen:rss:{
if (!$sockerr) {
var %s sockwrite -n rss
%s GET / $+ $rss.page HTTP/1.0
%s Host: $rss.site
%s
}
else rss.msg $gettok($sock(rss).mark,1,32) unable to retrieve rss feed, $sock(rss).wsmsg
}
on *:sockread:rss:{
var %r
sockread %r
if ($sockerr) return
tokenize 32 $sock(rss).mark
if (