X Tutup
Skip to content

Commit 36caf2d

Browse files
author
Danny Wilson
committed
Added who paramter to api.GetSearch
1 parent 9627866 commit 36caf2d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2015-10-05
2+
Added who to api.GetSearch
3+
14
2014-12-29
25
removed reference to simplejson
36

twitter/api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def ClearCredentials(self):
265265

266266
def GetSearch(self,
267267
term=None,
268+
who=None,
268269
geocode=None,
269270
since_id=None,
270271
max_id=None,
@@ -280,6 +281,8 @@ def GetSearch(self,
280281
Args:
281282
term:
282283
Term to search by. Optional if you include geocode.
284+
who:
285+
Handle of user's tweets you want. Optional.
283286
since_id:
284287
Returns results with an ID greater than (that is, more recent
285288
than) the specified ID. There are limits to the number of
@@ -348,12 +351,15 @@ def GetSearch(self,
348351
if locale:
349352
parameters['locale'] = locale
350353

351-
if term is None and geocode is None:
354+
if term is None and geocode is None and who is None:
352355
return []
353356

354357
if term is not None:
355358
parameters['q'] = term
356359

360+
if who is not None:
361+
parameters['q'] = "from:%s" % (who)
362+
357363
if geocode is not None:
358364
parameters['geocode'] = ','.join(map(str, geocode))
359365

0 commit comments

Comments
 (0)
X Tutup