Skip to content

Commit

Permalink
Fixed timing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelogaio committed Oct 6, 2016
1 parent fc131f6 commit bcf32c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions GiphyTrending.tingapp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ def clearScreen():

def loadurl():
loadingScreen()
url = 'http://api.giphy.com//v1/gifs/trending?limit=100&api_key=dc6zaTOxFJmzC'
url = 'http://api.giphy.com/v1/gifs/trending?limit=100&api_key=dc6zaTOxFJmzC'
state['json'] = json.load(urllib.urlopen(url))
state['pos'] = 45
state['pos'] = 45
#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']
print state['pos'], state['json']['data'][state['pos']]['images']['fixed_height_downsampled']['url'], state['img']

def switch(forward):
state['lapse'] = 0
Expand Down Expand Up @@ -96,7 +95,7 @@ def loop():
if not state['pause']:
if state['autoloop']:
state['lapse'] += 1;
if state['lapse'] > 1 * 30 * 2:
if state['lapse'] > 1 * 30 * 5:
state['lapse'] = 0
switch(True)
screen.fill(color='black')
Expand Down

0 comments on commit bcf32c2

Please sign in to comment.