Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l urlencode { return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2)) }
- alias imdb {
- if ($1) && ($1 == -i) { var -s %u = https://movie-database-imdb-alternative.p.rapidapi.com/?i= $+ $2 $+ &r=json }
- else { var %u = https://movie-database-imdb-alternative.p.rapidapi.com/?t= $+ $urlencode($1-) $+ &r=json }
- var %v = IMDB_ $+ $rand(1,1000000000)
- JSONOpen -udw %v %u
- if ($jsonerror) { echo 4 -gate Error: Connection problem! - Details: $jsonerror | return }
- JSONHttpMethod %v GET
- JSONHttpHeader %v X-RapidAPI-Host movie-database-imdb-alternative.p.rapidapi.com
- JSONHttpHeader %v X-RapidAPI-Key ENTER-API-KEY-HERE
- JSONHttpFetch %v
- var %response = $json(%v,Response).value
- var %error = $json(%v,Error).value
- if (%response) && (%error) { echo 4 -gate No results founded. | return }
- var %title = $json(%v,Title).value
- var %year = $json(%v,Year).value
- var %language = $json(%v,Language).value
- var %country = $json(%v,Country).value
- var %imdbrating = $json(%v,imdbRating).value
- var %imdbvotes = $json(%v,imdbVotes).value
- var %type = $json(%v,Type).value
- var %boxoffice = $json(%v,BoxOffice).value
- var %imdbid = $json(%v,imdbID).value
- 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)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement