This script accesses www.orlydb.com and pulls the newest Scene Releases and posts them on the channel.
Added Search function: !pre Release Name
Added where you can omit languages that you do not want to show.
Added option to turn the Pre announce on or off through the party line ".pre" in the party line will toggle settings
Fixed issue with program crashing after a few hours of running.
Fixed issue with search not working
## Displys Scene Releases that have been Pred on the website www.orlydb.com ##
namespace eval pre {
variable language "FRENCH|GERMAN|SWEDISH|DANSIH|DUTCH|FINNISH|NORWEGIAN|SPANiSH"
#"APPS 0DAY MOBILE ANiME AUDiOBOOKS COVERS DOX EBOOKS IMAGESET SAMPLES UNKNOWN MP3 MVIDS MDVDR TV TV-BLURAY TV-DVDR TV-DVDRiP TV-HR TV-x264 TV-XViD VCD BLURAY x264 XViD SVCD TRAILERS SUBPACK DiVX DVDR Wii XBOX XBOX360 GAMEBOY GAMECUBE GAMES DREAMCAST NDS PS1 PS2 PS3 PSP PSX PSXPSP XXX XXX-IMGSET"
variable types "APPS 0DAY MOBILE MP3 TV-DVDR TV-DVDRiP TV-HR TV-x264 TV-XViD x264 XViD XXX XXX-IMGSET"
#Set to channel to show Pre information
variable chan "#Chan"
#Change preNum to how many Search Results you want shown
variable Num 5
}
set PreNew ""
#Change to (on/off) to turn on pre bot
set status "on"
bind pub - !pre presearch
bind dcc - pre pre:change
proc pre {} {
global PreNew status
if {$status == "on"} {
set PreOld $PreNew
set url "http://www.orlydb.com"
set page [web2data $url]
if {$page!=0} {
regexp {"timestamp">(.*?)<\/span>} $page a stamp
regexp {"section"><a.*?>(.*?)<\/a>} $page a section
regexp {"release">(.*?)<\/span>} $page a release
if {[info exists release]} { set PreNew "$stamp $section $release"
if {![regexp -nocase $pre::language $release] && [regexp -nocase $section $pre::types] && $PreNew != $PreOld} { putquick "PRIVMSG $pre::chan :\00308(\00315PRE\00308)\00315 $stamp \00308(\00315$section\00308)\00315 $release" }
}
}
}
utimer 2 pre
}
proc pre:change {hand idx arg} {
global status
if {$status == "on"} { set status "off"
} else { set status "on" }
putdcc $idx "Pre status changed to: $status"
}
proc presearch { nick host hand chan arg } {
set arg [string map { " " "+" } $arg]
set url "http://www.orlydb.com/?q=$arg"
set page [web2data $url]
set temp 1
while {$temp <= $pre::Num && [regexp {<div>(.*?)<\/div>} $page a result]} {
if {[info exists result]} {
regexp {"timestamp">(.*?)<\/span>} $result a stamp
regexp {"section"><a.*?>(.*?)<\/a>} $result a section
regexp {"release">(.*?)<\/span>} $result a release
regsub {<div>(.*?)<\/div>} $page "" page
if {![regexp -nocase $pre::language $release]} {
if {[info exists release]} { incr temp
putquick "PRIVMSG $chan :\00304(\00315PRE\00304)\00315 $stamp \00304(\00315$section\00304)\00315 $release"
unset stamp section release
}
}
}
}
if {$temp==0} { putquick "PRIVMSG $chan :\00304(\00315PRE\00304)\00315 Nothing Found" }
}
proc web2data { website } {
package require http
if { [catch { set token [http::geturl $website -timeout 100000]} error] } { return 0
} elseif { [http::ncode $token] == "404" } { return 0
} elseif { [http::status $token] == "ok" } { set data [http::data $token]
} elseif { [http::status $token] == "timeout" } { return 0
} elseif { [http::status $token] == "error" } { return 0 }
http::cleanup $token
if { [info exists data] } { return $data
} else { return 0 }
}
utimer 2 pre
putlog "\00308(\00315PRE\00308)"
nice script gecko321, but I have a issue, if I a search something generic it works fine, but If I try searching something more specific it doesn't works. for sample:
<!admin> !pre dishonored
<@bot> (XBOX360) Dishonored-REPACK-PAL-XBOX360-DAGGER
<@bot> (XBOX360) Dishonored-PAL-XBOX360-DAGGER
<@bot> (GAMES) Dishonored.Fix-RELOADED
<@bot> (GAMES) Dishonored.Real.Proper-RELOADED
and with a specific search term:
<!admin> !pre Dishonored-REPACK-PAL-XBOX360-DAGGER
nothing happens. the idea is that when a make a specific search, it show something, because I use this to check if the release was nuked and which reason of the nuke.
Awesome. thank you.
i changed one thing:
putquick "PRIVMSG $chan :\00304(\00315PRE\00304)\00315 $stamp \00304(\00315$section\00304)\00315 $release"
to
putquick "PRIVMSG $nick :\00304(\00315PRE\00304)\00315 $stamp \00304(\00315$section\00304)\00315 $release"
so it send the search results as a message. please correct me if this is very wrong/stupid, as i have not done any tcl/irc coding.
plzz