11Python Twitter Search API
22=========================
33
4- This library serves as a Python interface to the `Twitter premium and
5- enterprise search
6- APIs <https://developer.twitter.com/en/docs /tweets/search/overview/ > `__.
7- It provides a command-line utility and a library usable from within a
4+ This library serves as a Python interface to the various `Twitter
5+ premium and enterprise search
6+ APIs <https://developer.twitter.com/en/products /tweets/search> `__. It
7+ provides a command-line utility and a library usable from within a
88Python program. It comes with tools for assisting in dynamic generation
99of search rules and for parsing tweets.
1010
@@ -14,6 +14,8 @@ Pretty docs can be seen
1414Features
1515========
1616
17+ - Supports 30-day Search and Full Archive Search (not the standard
18+ Search API).
1719- Command-line utility is pipeable to other tools (e.g., ``jq ``).
1820- Automatically handles pagination of results with specifiable limits
1921- Delivers a stream of data to the user for low in-memory requirements
@@ -138,7 +140,7 @@ Environment Variable Overrides
138140------------------------------
139141
140142If we set our environment variables, the program will look for them
141- regardless of a YAML file’ s validity or existence.
143+ regardless of a YAML file' s validity or existence.
142144
143145.. code :: python
144146
@@ -339,7 +341,7 @@ Using the Twitter Search APIs' Python Wrapper
339341Working with the API within a Python program is straightforward both for
340342Premium and Enterprise clients.
341343
342- We’ ll assume that credentials are in the default location,
344+ We' ll assume that credentials are in the default location,
343345``~/.twitter_keys.yaml ``.
344346
345347.. code :: python
@@ -371,7 +373,7 @@ sandbox environment can only have a max of 100 here, so if you get
371373errors, please check this) not including dates, and defaulting to hourly
372374counts when using the counts api. Discussing the finer points of
373375generating search rules is out of scope for these examples; I encourage
374- you to see the docs to learn the nuances within, but for now let’ s see
376+ you to see the docs to learn the nuances within, but for now let' s see
375377what a rule looks like.
376378
377379.. code :: python
@@ -393,23 +395,23 @@ requires less thought and knowledge, and interaction with the
393395Fast Way
394396--------
395397
396- We’ ll use the ``search_args `` variable to power the configuration point
398+ We' ll use the ``search_args `` variable to power the configuration point
397399for the API. The object also takes a valid PowerTrack rule and has
398400options to cutoff search when hitting limits on both number of Tweets
399401and API calls.
400402
401- We’ ll be using the ``collect_results `` function, which has three
403+ We' ll be using the ``collect_results `` function, which has three
402404parameters.
403405
404406- rule: a valid PowerTrack rule, referenced earlier
405407- max_results: as the API handles pagination, it will stop collecting
406408 when we get to this number
407- - result_stream_args: configuration args that we’ ve already specified.
409+ - result_stream_args: configuration args that we' ve already specified.
408410
409411For the remaining examples, please change the args to either premium or
410412enterprise depending on your usage.
411413
412- Let’ s see how it goes:
414+ Let' s see how it goes:
413415
414416.. code :: python
415417
@@ -488,8 +490,8 @@ number of Tweet attributes are made available directly, as such:
488490 Twitter for iPhone
489491
490492Voila, we have some Tweets. For interactive environments and other cases
491- where you don’ t care about collecting your data in a single load or
492- don’ t need to operate on the stream of Tweets or counts directly, I
493+ where you don' t care about collecting your data in a single load or
494+ don' t need to operate on the stream of Tweets or counts directly, I
493495recommend using this convenience function.
494496
495497Working with the ResultStream
@@ -619,7 +621,7 @@ Our results are pretty straightforward and can be rapidly used.
619621Dated searches / Full Archive Search
620622------------------------------------
621623
622- Let’ s make a new rule and pass it dates this time.
624+ Let' s make a new rule and pass it dates this time.
623625
624626``gen_rule_payload `` takes dates of the forms ``YYYY-mm-DD `` and
625627``YYYYmmDD ``.
0 commit comments