示例#1
0
文件: getdata.py 项目: schlosser/EtMe
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
示例#2
0
文件: getdata.py 项目: schlosser/EtMe
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
示例#3
0
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")
示例#4
0
def foursquare_connect():
    return redirect(makeClient().oauth.auth_url())
示例#5
0
文件: etme.py 项目: schlosser/EtMe
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")
示例#6
0
文件: etme.py 项目: schlosser/EtMe
def foursquare_connect():
    return redirect(makeClient().oauth.auth_url());