mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding a twitter sync for everybody.
This commit is contained in:
parent
745aa210d8
commit
cefae8b241
1 changed files with 7 additions and 4 deletions
|
@ -2581,10 +2581,13 @@ class MSocialServices(mongo.Document):
|
|||
return profile
|
||||
|
||||
@classmethod
|
||||
def sync_all_twitter_photos(cls, days=14):
|
||||
week_ago = datetime.datetime.now() - datetime.timedelta(days=days)
|
||||
shares = MSharedStory.objects.filter(shared_date__gte=week_ago)
|
||||
sharers = sorted(set([s.user_id for s in shares]))
|
||||
def sync_all_twitter_photos(cls, days=14, everybody=False):
|
||||
if everybody:
|
||||
sharers = [ss.user_id for ss in MSocialServices.objects.all().only('user_id')]
|
||||
elif days:
|
||||
week_ago = datetime.datetime.now() - datetime.timedelta(days=days)
|
||||
shares = MSharedStory.objects.filter(shared_date__gte=week_ago)
|
||||
sharers = sorted(set([s.user_id for s in shares]))
|
||||
print " ---> %s sharing user_ids" % len(sorted(sharers))
|
||||
|
||||
for user_id in sharers:
|
||||
|
|
Loading…
Add table
Reference in a new issue