IRC Pre Bot v2.1

By Gecko321 on Apr 06, 2012

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)"

Comments

Sign in to comment.
cookie00   -  May 09, 2014

Hello,

first very good work!!! thank you very much!
i need help.. if i search a rlsname nothin is happen.. i think its the same problem like unforgiving...

anyone can help to fix it pls??

thank a lot

 Respond  
unforgiving   -  Oct 10, 2012

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.

cookie00  -  May 09, 2014

i know what i the problem.. search for a rlsname without -affil ;) and it works

Sign in to comment

Fuzion   -  Jul 13, 2012

i'll pm u it :)

 Respond  
Gecko321   -  Jul 13, 2012

welcome.. where ru at.. might drop by and visit

 Respond  
Fuzion   -  Jul 12, 2012

great script gecko321 :) my users love it

 Respond  
Gecko321   -  Jul 09, 2012

That's right

 Respond  
chong   -  Jul 09, 2012

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.

 Respond  
Gecko321   -  Jul 09, 2012

I got it fixed. There was just a slight issue. But it's working again.

 Respond  
chong   -  Jul 09, 2012

Nice. thank you. i have one problem though. when i run a search it comes back with one result (max is set to 10) and an error from my eggdrop: Tcl error [presearch]: can't read "result": no such variable

any help would be greatly appreciated.

 Respond  
JD75   -  May 01, 2012

How to you start the script?

 Respond  
henkie2   -  Apr 22, 2012

Any change to set the sections as diff colors? and on pre/search to get (un)nukes, incl reasons?
Thx :)

 Respond  
xtas420   -  Apr 18, 2012

1.How to lower the count of releases which comes from !pre command.

  1. How can I ignore all foreign releases? or atleast some of them? finnish is good though
 Respond  
henkie2   -  Apr 15, 2012

Once again , thx and for your last updates :)
Little note, from here; after few hours the announces stops without a reason :P

 Respond  
henkie2   -  Apr 08, 2012

Thanks, any change to get search function on it?
example: !pre release_name_of_search to get results?

 Respond  
henkie2   -  Apr 08, 2012

N1 :)

JD75  -  Mar 23, 2013

Anybody else having problems with this script, it just stopped working for me ? And now its just not working.

Pjoff  -  Jan 24, 2017

The orlydb.com is not operational anymore

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.