pony

movies look up

Apr 1st, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. ON *:TEXT:*:#: {
  2. tokenize 32 $strip($1-)
  3. if ($1 == !movie) {
  4. if ($istok(-a -m -p,$2,32)) {
  5. set %movie.squery $replace($3-,$chr(32),$+($chr(37),20)) | set %movie.nick $nick | set %movie.chan $chan | set %movie.cat $2
  6. sockopen allmovie www.allmovie.com 80
  7. }
  8. else {
  9. if (!%movtrigusage) {
  10. set -u200 %movtrigusage 1
  11. .notice $nick USAGE: !movie <switch> <search_query> (switches: -a (all results) -m (movies only) -p (people only)
  12. }
  13. }
  14. }
  15. }
  16.  
  17. ON *:SOCKOPEN:allmovie: {
  18. sockwrite -nt $sockname GET $+(/search/,$iif(%movie.cat == -a, all, $iif(%movie.cat == -p, people, movies)),/,%movie.squery) HTTP/1.1
  19. sockwrite -nt $sockname Host: www.allmovie.com
  20. sockwrite -nt $sockname User-Agent: Mozilla/4.0
  21. sockwrite $sockname $crlf
  22. }
  23.  
  24. ON *:SOCKREAD:allmovie: {
  25. var %allmovie | sockread %allmovie
  26. if (*h1>No search results were found for*</h1* iswm %allmovie) {
  27. msg %movie.chan $+([,$chr(32),%movie.nick,$chr(32),]) No results were found for your query! Sorry :/ $iif(%movie.cat == -m, Maybe you were looking for a person ( -p ), $iif(%movie.cat == -p, Maybe you were looking for a movie ( -m ), $null)) $iif(%movie.cat != -a, Use -a for both movies and persons results!, $null)
  28. unset %movie.*
  29. sockclose $sockname
  30. }
  31. if (*search results for*</h1* iswm %allmovie) {
  32. tokenize 32 %allmovie
  33. set %movie.sere $1
  34. }
  35. if (*h4>Movie</h4* iswm %allmovie) || (*h4>Person</h4* iswm %allmovie) {
  36. set %movie.cucat $gettok($gettok(%allmovie,2,62),1,60)
  37. }
  38. if (%movie.cucat == Movie) {
  39. if (*href="http://www.allmovie.com/movie/* iswm %allmovie) {
  40. set %movie.link $gettok(%allmovie,2,34)
  41. set %movie.title $gettok($gettok(%allmovie,2,62),1,60)
  42. }
  43. if (*irected by:* iswm %allmovie) {
  44. set %movie.dirlink $gettok(%allmovie,2,34)
  45. set %movie.dir $gettok($gettok(%allmovie,2,62),1,60)
  46. }
  47. if (*http://www.allmovie.com/genre/* iswm %allmovie) {
  48. var %allmovie = $nohtml($replace(%allmovie,$chr(44),$chr(94)))
  49. if ($numtok(%allmovie,94)) {
  50. set %movie.genres $replace(%allmovie,$chr(94),$chr(44))
  51. }
  52. elseif (!$numtok(%allmovie,94)) {
  53. set %movie.genres %allmovie
  54. }
  55. inc %movie.count
  56. $iif(%movie.count == 1, msg %movie.chan 3< $+(www.allmovie.com,/search/,$iif(%movie.cat == -a, all, $iif(%movie.cat == -p, people, movies)),/,%movie.squery) 3>7 %movie.sere 3Results Found! 1st:, .timer 1 $plusadd(%movie.count) notice %movie.nick $ord(%movie.count)) $iif(%movie.cucat, 7Category:3 $v1, $null) 7Title: %movie.title 3< %movie.link 3> 7Director:3 %movie.dir < %movie.dirlink 3> $replace(%movie.genres,Genres:,$+($chr(03),07,Genres:,$chr(03),03))
  57. .timerendallmovie off
  58. .timerendallmovie 1 5 endallmovie
  59. }
  60. }
  61. if (%movie.cucat == Person) {
  62. if (*http://www.allmovie.com/artist/* iswm %allmovie) {
  63. set %movie.namelink $gettok(%allmovie,2,34)
  64. set %movie.name $gettok($gettok(%allmovie,2,62),1,60)
  65. }
  66. if (*"years-active"* iswm %allmovie) {
  67. set %movie.pyears $gettok($gettok(%allmovie,2,62),1,60)
  68. }
  69. if (*Notable Work:* iswm %allmovie) {
  70. set %movie.nworklink $gettok(%allmovie,2,34)
  71. set %movie.nwork $gettok($gettok(%allmovie,2,62),1,60) $gettok($gettok(%allmovie,4,62),1,60)
  72. inc %movie.count
  73. $iif(%movie.count == 1, msg %movie.chan 3< $+(www.allmovie.com,/search/,$iif(%movie.cat == -a, all, $iif(%movie.cat == -p, people, movies)),/,%movie.squery) 3>7 %movie.sere 3Results Found! 1st:, .timer 1 $plusadd(%movie.count) notice %movie.nick $ord(%movie.count)) $iif(%movie.cucat, 7Category:3 $v1, $null) 7Name:3 %movie.name 3< %movie.namelink 3> 7Years Active:3 %movie.pyears 7Notable Work:3 %movie.nwork < %movie.nworklink 3>
  74. .timerendallmovie off
  75. .timerendallmovie 1 5 endallmovie
  76. }
  77. }
  78. }
  79.  
  80. alias nohtml { return $regsubex($1, /<[^>]+(?:>|$)|^[^<>]+>/g,) }
  81.  
  82. alias endallmovie {
  83. if (!%movtrigad) {
  84. set -u7200 %movtrigad 1
  85. .timermovtrigad 1 10 msg %movie.chan All Movie Searcher mIRC Script by OrFeAsGr ( http://humanity.ucoz.com )
  86. }
  87. .sockclose allmovie | unset %movie.*
  88. }
  89.  
  90. alias plusadd { return $calc($1 + 1) }
Add Comment
Please, Sign In to add comment