Created
June 18, 2015 19:52
-
-
Save jkishner/736386a585d983dcc842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import sys | |
import urllib | |
import webbrowser | |
searchTitle = sys.argv[1] | |
newSearchTitle = urllib.quote(searchTitle, '') | |
searchYear = sys.argv[2] | |
data = requests.request('GET','http://www.omdbapi.com/?t=' + newSearchTitle + '&y=' + searchYear + '&r=json&tomatoes=true') | |
if data.status_code == 200: | |
response = json.loads(data.text) | |
title = response['Title'] | |
print title | |
year = response['Year'] | |
print year | |
rated = response['Rated'] | |
print rated | |
released = response['Released'] | |
print released | |
runtime = response['Runtime'] | |
print runtime | |
genre = response['Genre'] | |
print genre | |
director = response['Director'] | |
print director | |
metascore = response['Metascore'] | |
print metascore | |
imdbrating = response['imdbRating'] | |
print imdbrating | |
tomatometer = reponse['tomatoMeter'] | |
print tomatometer | |
#webbrowser.open('drafts://x-callback-url/create?text=' + img2 + '%0A%0A' + mid2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment