def getData(): client = makeClient() # Fetch accesscode from cookies access_token = session['access_token'] client.set_access_token(access_token) # Listing check-ins checkIns = client.users.checkins(params={'limit': 20})['checkins'] # Look for Tags venues = [] print len(checkIns['items']) for i in range(len(checkIns['items'])): checkIn = checkIns['items'][i] if checkIn['type'] == 'valueless': continue venues = venues + [checkIn['venue']['id']] tagSet = [] for i in venues: venue = client.venues(i)['venue'] if len(venue['tags']) >= 5: tagSet += venue['tags'][0:4] else: tagSet += venue['tags'] for j in venue['categories']: tagSet += [j['name']] return tagSet
def getData(): client = makeClient(); # Fetch accesscode from cookies access_token = session['access_token']; client.set_access_token(access_token); # Listing check-ins checkIns = client.users.checkins(params={'limit': 20})['checkins']; # Look for Tags venues = []; print len(checkIns['items']); for i in range(len(checkIns['items'])): checkIn=checkIns['items'][i]; if checkIn['type']=='valueless': continue; venues = venues + [checkIn['venue']['id']]; tagSet = []; for i in venues: venue = client.venues(i)['venue']; if len(venue['tags'])>=5 : tagSet += venue['tags'][0:4]; else: tagSet += venue['tags']; for j in venue['categories']: tagSet+= [j['name']]; return tagSet
def redirect_page(): client = makeClient() code = request.args.getlist("code") access_token = client.oauth.get_token(str(code[0])) session['access_token'] = access_token return redirect("/home")
def foursquare_connect(): return redirect(makeClient().oauth.auth_url())
def foursquare_connect(): return redirect(makeClient().oauth.auth_url());