Exemplo n.º 1
0
def update(cookie, cookieDict, text, query, tabName, sortKey):
    url = tweetURL(query, tabName, sortKey)
    if len(text) + 1 + BITLY_URL_LEN + 1 + len(_hashTag) <= 140:
        text = '%s %s %s' % (text, url, _hashTag)
    else:
        text = '%s %s' % (text, url)
    return twitter.updateStatus(text, cookie, cookieDict)
Exemplo n.º 2
0
def simpleUpdate(cookie, cookieDict, screennames, nUsers, sortKey, useAtSigns):
    for i, name in enumerate(screennames):
        if useAtSigns:
            if not name.startswith('@'):
                screennames[i] = '@' + name
        else:
            if name.startswith('@'):
                screennames[i] = name[1:]

    basic = '%s and %s follow %d people in common. See who: ' % (
        screennames[0], screennames[1], nUsers)
    url = simpleTweetURL(screennames, sortKey)

    if len(basic) + BITLY_URL_LEN + 1 + len(_hashTag) <= 140:
        text = '%s %s %s' % (basic, url, _hashTag)
    else:
        text = '%s %s' % (basic, url)
    return twitter.updateStatus(text, cookie, cookieDict)