Advertisement
westor

IMDB Search for isi1dur v1.0

Dec 18th, 2019
1,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.51 KB | None | 0 0
  1. alias -l urlencode { return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2)) }
  2.  
  3. alias imdb {
  4.   if ($1) && ($1 == -i) { var -s %u = https://movie-database-imdb-alternative.p.rapidapi.com/?i= $+ $2 $+ &r=json }
  5.   else { var %u = https://movie-database-imdb-alternative.p.rapidapi.com/?t= $+ $urlencode($1-) $+ &r=json }
  6.  
  7.   var %v = IMDB_ $+ $rand(1,1000000000)
  8.  
  9.   JSONOpen -udw %v %u
  10.  
  11.   if ($jsonerror) { echo 4 -gate Error: Connection problem! - Details: $jsonerror | return }
  12.  
  13.   JSONHttpMethod %v GET
  14.   JSONHttpHeader %v X-RapidAPI-Host movie-database-imdb-alternative.p.rapidapi.com
  15.   JSONHttpHeader %v X-RapidAPI-Key ENTER-API-KEY-HERE
  16.   JSONHttpFetch %v
  17.  
  18.   var %response = $json(%v,Response).value
  19.   var %error = $json(%v,Error).value
  20.  
  21.   if (%response) && (%error) { echo 4 -gate No results founded. | return }
  22.  
  23.   var %title = $json(%v,Title).value
  24.   var %year = $json(%v,Year).value
  25.   var %language = $json(%v,Language).value
  26.   var %country = $json(%v,Country).value
  27.   var %imdbrating = $json(%v,imdbRating).value
  28.   var %imdbvotes = $json(%v,imdbVotes).value
  29.   var %type = $json(%v,Type).value
  30.   var %boxoffice = $json(%v,BoxOffice).value
  31.   var %imdbid = $json(%v,imdbID).value
  32.  
  33.   echo 3 -gate Title: $iif(%title,$v1,N/A) - Year: $iif(%year,$v1,N/A) - Language: $iif(%language,$v1,N/A) - Country: $iif(%country,$v1,N/A) - IMDB Rating: $iif(%imdbrating,$v1,N/A) - IMDB Votes: $iif(%imdbvotes,$v1,N/A) - Type: $iif(%type,$v1,N/A) - BoxOffice: $iif(%boxoffice,$v1,N/A) - IMDB ID: $iif(%imdbid,$v1,N/A)
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement