From 070c4b8c8a9c73e00bd52ea20919c1a2894dcfa2 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sat, 17 Oct 2009 00:41:30 +0200 Subject: [PATCH] Only tweet things that have happened in the past 7 days, to avoid flooding the twitter feed when adding new blogs with many old entries. --- posttotwitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posttotwitter.py b/posttotwitter.py index b0048c0..9c13ab9 100755 --- a/posttotwitter.py +++ b/posttotwitter.py @@ -45,7 +45,7 @@ class PostToTwitter: c = self.db.cursor() c.execute("""SELECT posts.id, posts.title, posts.link, posts.shortlink, feeds.name, feeds.twitteruser FROM planet.posts INNER JOIN planet.feeds ON planet.posts.feed=planet.feeds.id - WHERE approved AND NOT (twittered OR hidden) ORDER BY dat""") + WHERE approved AND age(dat) < '7 days' AND NOT (twittered OR hidden) ORDER BY dat""") for post in c.fetchall(): if post[3] and len(post[3])>1: short = post[3] -- 2.39.5