Skip to content

Instantly share code, notes, and snippets.

@xecgr
Created May 11, 2016 19:01
Show Gist options
  • Save xecgr/beb70d38d0d6160837a22dc417637e33 to your computer and use it in GitHub Desktop.
Save xecgr/beb70d38d0d6160837a22dc417637e33 to your computer and use it in GitHub Desktop.
import requests
device_id = 'betabeers'
lang = 'es'
choice = ''
page_size = 20
while not choice:
choice = raw_input("Hola mestre, quin hashtag vols hackejar?: ")
more = ''
loops = 0
while not more:
url = 'http://letstagapp.com:8080/api/v2/search/{hashtag}?lang={lang}&device_id={device_id}&num={end_page}&start={start_page}'.format(
hashtag = choice,
lang = lang,
device_id = device_id,
end_page = (loops+1)*page_size,
start_page = loops*page_size,
)
r = requests.get(url)
for t in r.json().get('tags',[]):
print t
more = raw_input("Mestre, en vols mes?: [intro si, introdueix qualsevol cosa per acabar]: ")
loops =+ 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment