Created
December 19, 2012 06:13
-
-
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.
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
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