Esempio n. 1
0
def user_timeline2(user_id, since_id = None, 
                   oauth_token = None, 
                   oauth_token_secret = None):
    params = { 'id':  user_id}
    if since_id:
        params['since_id'] = since_id

    if oauth_token:
        params = get_oauth_params(oauth_token = oauth_token)
    
    url = 'http://twitter.com/statuses/user_timeline.json'
    result = api_get(url, params, oauth_token_secret)
    if not result:
        return None

    ret = json.loads(result)
    return ret
Esempio n. 2
0
def user_timeline2(user_id,
                   since_id=None,
                   oauth_token=None,
                   oauth_token_secret=None):
    params = {'id': user_id}
    if since_id:
        params['since_id'] = since_id

    if oauth_token:
        params = get_oauth_params(oauth_token=oauth_token)

    url = 'http://twitter.com/statuses/user_timeline.json'
    result = api_get(url, params, oauth_token_secret)
    if not result:
        return None

    ret = json.loads(result)
    return ret
Esempio n. 3
0
def update(status,
           lat = None, 
           lng = None, 
           display_coordinates = 'false',  
           oauth_token = None, 
           oauth_token_secret = None):
    params = get_oauth_params(oauth_token = oauth_token)
    params['status']  = status

    if lat:
        params['lat'] = lat
    if lng:
        params['long'] = lng

    url = 'http://api.twitter.com/1/statuses/update.json'
    result = api_post(url, params, oauth_token_secret)
    if not result:
        return None

    ret = json.loads(result)
    return ret
Esempio n. 4
0
def update(status,
           lat=None,
           lng=None,
           display_coordinates='false',
           oauth_token=None,
           oauth_token_secret=None):
    params = get_oauth_params(oauth_token=oauth_token)
    params['status'] = status

    if lat:
        params['lat'] = lat
    if lng:
        params['long'] = lng

    url = 'http://api.twitter.com/1/statuses/update.json'
    result = api_post(url, params, oauth_token_secret)
    if not result:
        return None

    ret = json.loads(result)
    return ret