Last active
March 29, 2017 00:24
-
-
Save SarahTaylorProject/ad06db41cf788d6ea233ba7e9bf61bee to your computer and use it in GitHub Desktop.
testing movie API
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
irb | |
# http://www.omdbapi.com/ | |
test2 = %q{{"Title":"Avengers: Age of Ultron","Year":"2015","Rated":"PG-13","Released":"01 May 2015","Runtime":"141 min","Genre":"Action, Adventure, Sci-Fi","Director":"Joss Whedon","Writer":"Joss Whedon, Stan Lee (based on the Marvel comics by), Jack Kirby (based on the Marvel comics by), Joe Simon (character created by: Captain America), Jack Kirby (character created by: Captain America), Jim Starlin (character created by: Thanos)","Actors":"Robert Downey Jr., Chris Hemsworth, Mark Ruffalo, Chris Evans","Plot":"When Tony Stark and Bruce Banner try to jump-start a dormant peacekeeping program called Ultron, things go horribly wrong and it's up to Earth's Mightiest Heroes to stop the villainous Ultron from enacting his terrible plans.","Language":"English","Country":"USA","Awards":"5 wins & 42 nominations.","Poster":"https://images-na.ssl-images-amazon.com/images/M/MV5BMTM4OGJmNWMtOTM4Ni00NTE3LTg3MDItZmQxYjc4N2JhNmUxXkEyXkFqcGdeQXVyNTgzMDMzMTg@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.4/10"},{"Source":"Rotten Tomatoes","Value":"75%"},{"Source":"Metacritic","Value":"66/100"}],"Metascore":"66","imdbRating":"7.4","imdbVotes":"506,752","imdbID":"tt2395427","Type":"movie","DVD":"02 Oct 2015","BoxOffice":"$429,113,729.00","Production":"Walt Disney Pictures","Website":"http://marvel.com/avengers","Response":"True"}} | |
moviehash = JSON.parse(test2) | |
moviehash.keys | |
moviehash["Writer"].split(",").map { |x| x.gsub(/\(.+\)/, "").strip } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment