Esempio n. 1
0
def update_timeline(user_id, must_include=lambda x: True):
    """
    Try to download the entire timeline of the use starting from a given page.
    Before starting issuing requests the last tweet_id of the user is retrieved if present.

    @return a TwitterResponse
    """
    # Here we just need to load the first line and get the id_str of the first
    # tweet. We are also assuming the file is there and accassible

    log.msg("Downloading updates of user_id %d" % user_id)

    writer = TimelineFile(user_id)

    abort = False

    try:
        abort = (writer.get_total() == 0)
        first_tweet = writer.get_first()
        since_id = int(first_tweet['id_str'])
    except Exception, exc:
        abort = True
Esempio n. 2
0
def update_timeline(user_id, must_include=lambda x: True):
    """
    Try to download the entire timeline of the use starting from a given page.
    Before starting issuing requests the last tweet_id of the user is retrieved if present.

    @return a TwitterResponse
    """
    # Here we just need to load the first line and get the id_str of the first
    # tweet. We are also assuming the file is there and accassible

    log.msg("Downloading updates of user_id %d" % user_id)

    writer = TimelineFile(user_id)

    abort = False

    try:
        abort = (writer.get_total() == 0)
        first_tweet = writer.get_first()
        since_id = int(first_tweet['id_str'])
    except Exception, exc:
        abort = True