All pastes #710567 Raw Edit

Meins

public text v1 · immutable
#710567 ·published 2007-09-25 16:52 UTC
rendered paste body
/*
#################### I and I Scripts for mIRC ####################
Script made for Roscoe on EFnet.  
Triggers:
!chkrls moviename
!id #

Please note:  Cinefacts.de changes their server format often so I
coded this script to query the Cinefacts.de site.  The !chkrls 
trigger retrieves the database ID number for the movie query be-
cause of a 501 server side redirect.  The !id trigger queries the
Cinefacts.de site using Google.com's query and retreiving the full
server side redirect url using the ID number retrieved by the ini-
tial !chrls query.  This code is very sloppy but it works.  

Caveat Emptor!  This code is quite sloppy but will not leave your
computer too vulnerable.  I haven't made a flood protrection script
as of yet but I may do so in future.

Contact me if you have any questions.
/Zig
################# Need help? ziggizman@gmail.com #################
*/
on *:TEXT:*:#sn00ty:{
  if ($window(@url) != @url) {
  //echo -a alias chkrls works
    windz
  }
  if ($1 == !chkrls) && ( $2- != $null ) {
    clearkino
    .notice $nick * Performing search for: $2-
    checkrelease $2- 
    set %check.chan $chan
    set %check.nick $nick
  }
  if ($1 == !chkrls) && ( $2- == $null ) {
    //echo -a alias checkrelease works
    .notice $nick * Error - Use format: !chkrls search string - example !chkrls hackers
  }
  if ($1 == !id) && ($2 == $null) {
    //echo -a alias checkrelease works
    .notice $nick * Error - Use format: !id id# - example: !id 36945
    halt
  }
  if ($1 == !id) && ($2 != $remove($abs($2),.,-,/,_,\,>,<,+,=,*,&,%,$,#,@,?,$chr(44))) {
    //echo -a alias checkrelease works
    .notice $nick * Error - Use format: !id id# - example: !id 36945
  }
  if ($1 == !id) && ($2 == $remove($abs($2),.,-,/,_,\,>,<,+,=,*,&,%,$,#,@,?,$chr(44))) {
    //echo -a alias checkrelease works
    .notice $nick * Retreiving film information
    set %idno $2
    checkid
    set %check.chan $chan
    set %check.nick $nick
  }
  if ($1 == !cinehelp) {
    //echo -a alias checkrelease works
    .notice $nick * To search for a film name in the database use format: !chkrls search string - example !chkrls hackers
    .notice $nick * To search for specific film information use format: !id id# - example: !id 36945
  }
}
alias checkrelease {
  if ($1- != $null) {
    //echo -a alias checkrelease works
    if ( $sock(checkrelease) ) { SOCKCLOSE checkrelease }
    sockopen checkrelease www.cinefacts.de 80
    sockmark checkrelease $1-
  }
  else { echo -a Bitte Releasenamen angeben! }
}
on *:sockopen:checkrelease: {
  //echo -a alias checkrelease works
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  var %s = $gettok($sock($sockname).mark,$+(1,-,$calc($numtok($sock($sockname).mark,46) - 3)),46)
  var %s = $replace(%s,.,$chr(32),$chr(32),+)
  var %s = $remove(%s,DTS,UNRATED,German,DVDSCR,XViD,TS,LD,DVDRiP,MD,PROPER,AC3,FS,Line,Dubbed,REPACK,TELESYNC,UNCUT,COMPLETE,PAL,DVDR,iNTERNAL,DL,DiRFiX,SVCD,STV,R5,1999,2000,2001,2002,2003,2004,2005,2006,2007)
  sockwrite -n $sockname GET /suche/suche.php?name= $+ %s $+ &go.x=0&go.y=0 HTTP/1.0
  sockwrite -n $sockname Host: cinefacts.de
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname
}
on *:sockread:checkrelease: {
  //echo -a alias checkrelease works
  var %temp
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  else {
    sockread %temp
    if (*<b title=* iswm %temp) {
      aline @titel $gettok(%temp,2,34)
    }
    if (*<a href="/kino/db/filmdetails.php?id=*details* iswm %temp) { 
      aline @url $gettok(%temp,2,34)
    }
    if (*&nbsp;|&nbsp;*</td>* iswm %temp) {
      aline @kinoinfo $replace(%temp,$chr(9),,<br>,$chr(32) -,&nbsp;|&nbsp;,$chr(32) -,</td>,)
    }
    if (*Bitte geben Sie einen Suchbegriff ein.* iswm %temp) {
      .notice %check.nick **** Bitte geben Sie einen Suchbegriff ein ****
      unsett
      halt
    }
  }
}
on *:SOCKCLOSE:checkrelease: {
  //echo -a alias checkrelease works
  var %titleread = 1, %kino.id = $gettok($line(@url,%titleread),2,61), %kino.title = $line(@titel,%titleread), %kino.info = $line(@kinoinfo,%titleread)
  set %urltitle $line(@url,0)
  filter -cwwr 1- $+ $line(@url,0) @titel @titel
  filter -cwwr 1- $+ $line(@url,0) @kinoinfo @kinoinfo
  if ($line(@url,0) == 1) {
    .notice %check.nick * %urltitle title Found
    .notice %check.nick  %titleread $+ . ID# $gettok($line(@url,%titleread),2,61) Title: $line(@titel,%titleread) Desc: $line(@kinoinfo,%titleread)
  }
  if ($line(@url,0) < 1) {
  //echo -a alias checkrelease works
    .notice %check.nick * %urltitle title's Found
    while (%titleread <= $line(@url,0)) {
      .notice %check.nick  %titleread $+ . ID# $gettok($line(@url,%titleread),2,61) Title: $line(@titel,%titleread) Desc: $line(@kinoinfo,%titleread)
      inc %titleread
    }
  }
  .notice %check.nick * For further information on a specific movie: !id id# - example: !id 36945
}
alias checkid {
  //echo -a alias checkid works
  if ( $sock(checkid) ) { SOCKCLOSE checkid }
  sockopen checkid www.google.com 80
  sockmark checkid 
}
on *:sockopen:checkid: {
  //echo -a alias checkid works
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  ;  sockwrite -n $sockname GET / HTTP/1.0
  sockwrite -n $sockname GET /search?hl=en&safe=off&q=cinefacts+kino+ $+ %idno $+ +filmdetails&btnG=Search HTTP/1.0
  sockwrite -n $sockname Host: www.google.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname 
}
on *:sockread:checkid: {
  //echo -a alias checkid works
  var %semp
  sockread %semp
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  if (*<h2 class=r>*www.cinefacts.de/kino/ $+ %idno $+ *filmdetails.html* iswm %semp) {
    set %cine $gettok($wildtok(%semp,*www.cinefacts.de/kino/*,1,32),2,34)
    set %cine1 $gettok(%cine,2,47)
    set %cine2 $gettok(%cine,3- $+ $numtok(%cine,47),47)
    set %cine3 $replace($gettok($replace($gettok($wildtok(%semp,*www.cinefacts.de/kino/*,1,32),2,34),http://,),4,47),_,$chr(32))
    alernick
    cinefacts
  }
}
on *:sockopen:cinefacts: {
  //echo -a alias checkid works
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  sockwrite -n $sockname GET / $+ %cine2 HTTP/1.0
  sockwrite -n $sockname Host: www.cinefacts.de
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname 
}
on *:sockread:cinefacts: {
  //echo -a alias checkid works
  var %remp
  sockread %remp
  if ( $sockerr ) { echo -aec info * checkrelease: Error: $sock($sockname).wsmsg | return }
  if (*<dd class="first">*.*.*</dd>*Produktionsland:* iswm %remp) {
    set %dls $replace($gettok(%remp,2,$chr(57)),$chr(9),,<dd class="first">,,</dd>,)
  }
  if (*landliste* iswm %remp) {
    set %pls $replace(%remp,$chr(9),,$chr(32),)
  }
}
on *:SOCKCLOSE:cinefacts: {
  set %b $remove($gettok(%pls,3,62),$chr(60) $+ $chr(47) $+ a,)
  if (%dls == $null) {
    set %dls N/A
  }
  if ($remove($gettok(%pls,3,62),$chr(60) $+ $chr(47) $+ a,) == $null) {
    set %b N/A
  }
  .notice %check.nick film: %cine3 - deutschlandstart: %dls  - produktionsland: %b
  unsett
}
alias cinefacts {
  //echo -a alias cinefacts works
  if ( $sock(cinefacts) ) { SOCKCLOSE cinefacts }
  sockopen cinefacts www.cinefacts.de 80
  sockmark cinefacts
}
alias alernick {
  //echo -a alias alernick works
  .notice %check.nick * Please stand by....
}
alias windz {
  //echo -a alias windz works
  window @titel 900 100 350 150
  window @URL 900 300 350 150
  window @kinoinfo 900 700 350 150
}
alias clearkino {
  //echo -a alias clearkino works
  clear @titel
  clear @url
  clear @kinoinfo
}
alias unsett {
  //echo -a alias unset works
  unset %urltitle
  unset %check.chan
  unset %check.nick
  unset %checknick
  unset %checkchan
  unset %idno
  unset %temp
  unset %check.chan
  unset %check.nick
  unset %urltitle
  unset %cine
  unset %cine1
  unset %cine2
  unset %cine3
  unset %dls
  unset %pls
  unset %a
  unset %b
}