Last active
September 29, 2015 20:30
-
-
Save hancush/d74a5f6d8e0ea8f5e0a0 to your computer and use it in GitHub Desktop.
uses known active location ids forked from gramfeed
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
from instagram.client import InstagramAPI | |
import httplib2 | |
import simplejson | |
import six | |
api = InstagramAPI( | |
client_id='adeb7a8be4d0463b8bae5e12df37145e', | |
client_secret='428e9e381d3e4a9298a307fd322aaf24', | |
access_token='181028960.adeb7a8.43b0ef71f8df44cda7e75c6e10740672' | |
) | |
locations = [299041182, | |
336430891, | |
13404453, | |
260477579, | |
563804, | |
222677308, | |
296610891, | |
214449943, | |
239685015, | |
268922155, | |
1015930487, | |
501169557, | |
1775602] | |
day_count = 0 | |
def count(place): | |
recent_media, next = api.location_recent_media( | |
location_id=place, | |
min_timestamp=1443454200 | |
) | |
while next: | |
more_media, next = api.location_recent_media( | |
location_id=place, | |
min_timestamp=1443454200, | |
with_next_url=next | |
) | |
for post in recent_media: | |
global day_count | |
day_count += 1 | |
print "Found {0} photos so far...".format(day_count) | |
for place in locations: | |
count(place) | |
week_count = day_count * 7 | |
print "{0} photos total found in the last 24 hours. That's {1} in a week.".format( | |
day_count, | |
week_count | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment