Skip to content

Instantly share code, notes, and snippets.

@ratnose
Created April 7, 2015 05:47
Show Gist options
  • Save ratnose/cf0152b1999c30c68cdc to your computer and use it in GitHub Desktop.
Save ratnose/cf0152b1999c30c68cdc to your computer and use it in GitHub Desktop.
response = JSON.parse(Net::HTTP.get(URI.parse('https://api.instagram.com/v1/tags/myTag/media/recent?client_id=myClinetID')))
img = response["data"][0]["images"]["low_resolution"]["url"]
caption = response["data"][0]["caption"]["text"]
if Image.where(:url = img).blank?
saveImage = Image.create(:url => img, :text => caption)
end
When I run this, I get:
./getImages.rb: line 1: syntax error near unexpected token `('
./getImages.rb: line 1: `response = JSON.parse(Net::HTTP.get(URI.parse('https://api.instagram.com/v1/tags/myTag/media/recent?client_id=myClientID')))'
I dont get it...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment