Project

General

Profile

IMDB title grabber

Added by tinybut strong almost 12 years ago

Hey, can you help me to make this mIRC script to work in AdiIRC latest beta?

;-------------------------------------------;
;        IMDb Title/Trailer Grabber       ;
;-------------------------------------------;
alias -l sockopenmark { sockopen $1-3 | sockmark $1 $4- }
on $*:text:/imdb\.com\/title\/([a-z0-9]+)/i:*: {
  sockopenmark $+(imdb.,$calc($ticks + $rand(1,99))) www.imdb.com 80 $regml(1) msg $iif($chan,$v1,$nick) $+($chr(02),$chr(03),01,$chr(44),08,IMDb,$chr(3)) $+($chr(02),::,$chr(32),Trailer:,$chr(32),$chr(31),http://www.imdb.com/video/imdb/)
}
on *:sockopen:imdb.*: { 
  if ($sockerr) { echo -a Error. | halt }
  else {
    tokenize 32 $sock($sockname).mark
    sockwrite -n $sockname GET /title/ $+ $1 $+ / HTTP/1.0 
    sockwrite -n $sockname HOST: www.imdb.com $+ $str($crlf,2)
  }
}
on *:sockread:imdb.*: {
  var %v | sockread %v
  if ($regex(%v,/<title>(.*?)</title>/)) { tokenize 32 $sock($sockname).mark  | sockmark $sockname $1-4 $remove($regml(1),- IMDb) $5- }
  if (($regex(%v,/data-video="([^"]+)")/) && (*Watch Trailer*</a>* iswmcs %v)) { tokenize 32 $sock($sockname).mark | $2- $+ $regml(1) $+ / | sockclose $sockname }
}

I got it from http://www.hawkee.com/snippet/9375/

ps: current IMDB example in wiki isn't working too: http://dev.adiirc.com/projects/adiirc/wiki/Scripting_BETA

Thank you!


Replies (6)

RE: IMDB title grabber - Added by Per Amundsen almost 12 years ago

Hm they both seem to work here, on the wiki notice this "On :TEXT::#k: {" you might have to change #k to * or the channel you want it to work in.

IMDB title grabber seems to work, it gets the title and makes a link to the trailer, there is a bug however with the output:

<kr0n> IMDb :: Trailer: http://www.imdb.com/video/imdb/ Kramer mot Kramer (1979) :: Trailer: http://www.imdb.com/video/imdb/vi2588606489/

I'm gonna fix that today.

Also remember both these scripts will not trigger when you yourself paste a imdb link, only other users.

Oh and do you get any script errors ? either in the channel window or in File -> Rawlog -> Debug.

RE: IMDB title grabber - Added by Per Amundsen almost 12 years ago

The display bug is fixed now in the latest beta :)

RE: IMDB title grabber - Added by tinybut strong almost 12 years ago

Strange, it's not working properly here, output in rawlog bellow.

 <- :tbs!mirc@CEA95246.639A9F76.54856799.IP PRIVMSG #testinggg :http://www.imdb.com/title/tt1327194/
 -> sockopenmark imdb.857312716 www.imdb.com 80 tt1327194 msg #testinggg IMDb :: Trailer: http://www.imdb.com/video/imdb/
 <- :irc.adichat.dk 421 blablabla sockopenmark :Unknown command

And no output in channel.

build 111212.

RE: IMDB title grabber - Added by Per Amundsen almost 12 years ago

Hm it seems it haven't registered that sockopenmark is an alias, could you try it like this "alias sockopenmark { sockopen $1-3 | sockmark $1 $4- }" without the "-l"

RE: IMDB title grabber - Added by tinybut strong almost 12 years ago

oh, sorry! Found the problem, was using other similar script, maybe var conflict or something like.

Thank you for fixing it!!

AdiIRC the real replace for mIRC.

RE: IMDB title grabber - Added by Per Amundsen almost 12 years ago

Cheers, thanks for reporting and please let me know if you find any other bug/issues :)

    (1-6/6)