mirror of
https://github.com/cquest/tootbot.git
synced 2025-01-18 04:16:59 +00:00
age param
This commit is contained in:
parent
184ab026f4
commit
91f811ecbb
|
@ -40,9 +40,11 @@ for t in reversed(d.entries):
|
|||
# check if this tweet has been processed
|
||||
db.execute('SELECT * FROM tweets WHERE tweet = ? AND twitter = ? and mastodon = ? and instance = ?', (t.id, source, mastodon, instance)) # noqa
|
||||
last = db.fetchone()
|
||||
|
||||
dt = t.published_parsed
|
||||
age = datetime.now()-datetime(dt.tm_year, dt.tm_mon, dt.tm_mday,
|
||||
dt.tm_hour, dt.tm_min, dt.tm_sec)
|
||||
# process only unprocessed tweets less than 1 day old
|
||||
if last is None and (datetime.now()-datetime(t.published_parsed.tm_year, t.published_parsed.tm_mon, t.published_parsed.tm_mday, t.published_parsed.tm_hour, t.published_parsed.tm_min, t.published_parsed.tm_sec) < timedelta(days=days)):
|
||||
if last is None and age < timedelta(days=days):
|
||||
if mastodon_api is None:
|
||||
# Create application if it does not exist
|
||||
if not os.path.isfile(instance+'.secret'):
|
||||
|
|
Loading…
Reference in New Issue
Block a user