Skip to content

Instantly share code, notes, and snippets.

@tjhanley
Created December 19, 2012 06:13
Show Gist options
  • Save tjhanley/4334765 to your computer and use it in GitHub Desktop.
Save tjhanley/4334765 to your computer and use it in GitHub Desktop.
instagram slurp. Working on a script to get all of your instagram pictures.
require 'rubygems'
require 'httparty'
require 'hashie'
require 'yaml'
YAML::ENGINE.yamler = 'syck'
YOUR_ACCESS_TOKEN = 'something'
url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=#{YOUR_ACCESS_TOKEN}&count=300'
response = Hashie::Mash.new(HTTParty.get(url))
while response["pagination"]
begin
puts "page 1"
response = Hashie::Mash.new(HTTParty.get(response["pagination"]["next_url"]))
rescue Exception => e
puts "done"
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment