Use user_timeline instead of search

This commit is contained in:
Klaus-Uwe Mitterer 2017-03-20 19:05:07 +01:00
parent 7c508ddff5
commit 003183ed0d

View file

@ -3,11 +3,10 @@
import argparse, dbtools, filters.filler, mediatools, requests, setuptools, time, twitools import argparse, dbtools, filters.filler, mediatools, requests, setuptools, time, twitools
def getTweets(db=dbtools.dbHelper(), user=twitools.twObject().whoami(), two=twitools.twObject()): def getTweets(db=dbtools.dbHelper(), user=twitools.twObject().whoami(), two=twitools.twObject()):
query = "from:" + user
savepoint = db.getLatestTweet() + 1 savepoint = db.getLatestTweet() + 1
last = savepoint last = savepoint
timeline = two.search(query, savepoint) timeline = two.api.user_timeline(screen_name = user, since_id = savepoint, include_rts = True)
tw_counter = 0 tw_counter = 0