Skip to content

Commit

Permalink
Fixed random
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelogaio committed Oct 6, 2016
1 parent bcf32c2 commit d3bb91b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions GiphyTrending.tingapp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ def loadurl():
loadingScreen()
url = 'http://api.giphy.com/v1/gifs/trending?limit=100&api_key=dc6zaTOxFJmzC'
state['json'] = json.load(urllib.urlopen(url))
state['pos'] = 45
#random.randrange(0,len(state['json']['data']),1)
state['pos'] = random.randrange(0,len(state['json']['data']),1)
query()

def query():
state['img'] = state['json']['data'][state['pos']]['images']['fixed_height_downsampled']['url']
if state['img'] == "":
state['img'] = state['json']['data'][state['pos']]['images']['fixed_height']['url']

def switch(forward):
state['lapse'] = 0
Expand Down

0 comments on commit d3bb91b

Please sign in to comment.