Skip to content

Commit

Permalink
Merge branch 'Sajam-add-since-filter'
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoepp committed Jan 1, 2018
2 parents 0b27112 + 9458ee3 commit 73fac8c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TwitterSearch/TwitterSearchOrder.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,16 @@ def set_until(self, date):
self.arguments.update({'until': '%s' % date.strftime('%Y-%m-%d')})
else:
raise TwitterSearchException(1007)

def set_since(self, date):
""" Sets 'since' parameter used to return \
only tweets generated after the given date
:param date: A datetime instance
:raises: TwitterSearchException
"""

if isinstance(date, datetime.date) and date <= datetime.date.today():
self.arguments.update({'since': '%s' % date.strftime('%Y-%m-%d')})
else:
raise TwitterSearchException(1007)

0 comments on commit 73fac8c

Please sign in to comment.