Created
June 18, 2014 03:02
-
-
Save techinpark2/044bf70a201ad20deb2a to your computer and use it in GitHub Desktop.
InstaAuto.py
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 urllib | |
import json | |
target_url = "https://api.instagram.com/v1/tags/%EC%85%80%EC%B9%B4/media/recent?access_token=[YOUR_ACCESS_TOKEN_HERE]" | |
handle = urllib.urlopen(target_url) | |
data = handle.read() | |
json = json.loads(data) | |
params = urllib.urlencode({ | |
'access_token':'[YOUR_ACCESS_TOKEN_HERE]' | |
}) | |
for media in json['data']: | |
media_url = " https://api.instagram.com/v1/media/"+media['id']+"/likes" | |
post = urllib.urlopen(media_url,params).read() | |
print media['user']['username']+" has like photos" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment