Exemplo n.º 1
0
def approve_pending_friends(api=None):
    if not api:
        api = FSQ(HEADERS)
    p = api.get_pending_friends(_USER, _PASS)
    if not p or 'requests' not in p:
        return
    friends = p['requests']
    for f in friends:
        uid = f['id']
        resp = api.approve_friend(_USER, _PASS, uid)
    if friends:
        _log.warn("Approved %s 4sq friends:\n%s", len(friends), friends)
    return friends