Skip to content

Instantly share code, notes, and snippets.

@hancush
Last active September 29, 2015 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hancush/d74a5f6d8e0ea8f5e0a0 to your computer and use it in GitHub Desktop.
Save hancush/d74a5f6d8e0ea8f5e0a0 to your computer and use it in GitHub Desktop.
uses known active location ids forked from gramfeed
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