Skip to content

Commit f4e0719

Browse files
author
Aaron Gonzales
committed
updated readme
1 parent fbcf741 commit f4e0719

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

README.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ throughout your program's session. Note that any method of storing your
153153
credentials is valid here; I am using environment variables for ease of
154154
use.
155155

156-
.. code:: ipython3
156+
.. code:: python
157157
158158
import os
159159
import json
@@ -165,7 +165,7 @@ Enterprise setup
165165
If you are an enterprise customer, you'll need to authenticate with a
166166
basic username/password method. You can specify that here:
167167

168-
.. code:: ipython3
168+
.. code:: python
169169
170170
# set your environment variables here for enterprise access if you need to
171171
# os.environ["TWITTER_SEARCH_ACCOUNT_NAME"] = ""
@@ -183,7 +183,7 @@ Premium Setup
183183
Premium customers will use a bearer token for authentication. Use the
184184
following cell for setup:
185185

186-
.. code:: ipython3
186+
.. code:: python
187187
188188
# set your environment variables here for premium access if you need to
189189
# os.environ["TWITTER_SEARCH_BEARER_TOKEN"] = ""
@@ -212,7 +212,7 @@ generating search rules is out of scope for these examples; I encourage
212212
you to see the docs to learn the nuances within, but for now let's see
213213
what a rule looks like.
214214

215-
.. code:: ipython3
215+
.. code:: python
216216
217217
rule = gen_rule_payload("@robotprincessfi", max_results=100) # testing with a sandbox account
218218
print(rule)
@@ -252,11 +252,11 @@ enterprise depending on your usage.
252252

253253
Let's see how it goes:
254254

255-
.. code:: ipython3
255+
.. code:: python
256256
257257
from twittersearch import collect_results
258258
259-
.. code:: ipython3
259+
.. code:: python
260260
261261
tweets = collect_results(rule, max_results=500, result_stream_args=premium_search_args) # change this if you need to
262262
@@ -266,7 +266,7 @@ Let's see how it goes:
266266
using bearer token for authentication
267267
268268
269-
.. code:: ipython3
269+
.. code:: python
270270
271271
[(tweet.id, tweet.all_text, tweet.hashtags) for tweet in tweets[0:10]]
272272
@@ -294,11 +294,11 @@ The ResultStream object will be powered by the ``search_args``, and
294294
takes the rules and other configuration parameters, including a hard
295295
stop on number of pages to limit your API call usage.
296296

297-
.. code:: ipython3
297+
.. code:: python
298298
299299
rs = ResultStream(**premium_search_args, rule_payload=rule, max_results=500, max_pages=1, )
300300
301-
.. code:: ipython3
301+
.. code:: python
302302
303303
print(rs)
304304
@@ -322,7 +322,7 @@ There is a function, ``.stream``, that seamlessly handles requests and
322322
pagination for a given query. It returns a generator, and to grab our
323323
500 tweets that mention ``@robotprincessfi`` we can do this:
324324

325-
.. code:: ipython3
325+
.. code:: python
326326
327327
tweets = list(rs.stream())
328328
@@ -335,7 +335,7 @@ pagination for a given query. It returns a generator, and to grab our
335335
Tweets are lazily parsed using our Tweet Parser, so tweet data is very
336336
easily extractable.
337337

338-
.. code:: ipython3
338+
.. code:: python
339339
340340
[(tweet.id, tweet.all_text, tweet.hashtags) for tweet in tweets[0:10]]
341341
@@ -356,7 +356,7 @@ takes dates of the forms ``YYYY-mm-DD`` and ``YYYYmmDD``. Note that this
356356
will only work with the full archive search option, which is available
357357
to my account only via the enterprise options.
358358

359-
.. code:: ipython3
359+
.. code:: python
360360
361361
rule = gen_rule_payload("from:jack", from_date="2017-09-01", to_date="2017-10-30", max_results=100)
362362
print(rule)
@@ -367,7 +367,7 @@ to my account only via the enterprise options.
367367
{"query":"from:jack","maxResults":100,"toDate":"201710300000","fromDate":"201709010000"}
368368
369369
370-
.. code:: ipython3
370+
.. code:: python
371371
372372
tweets = collect_results(rule, max_results=500, result_stream_args=enterprise_search_args)
373373
@@ -377,7 +377,7 @@ to my account only via the enterprise options.
377377
using username and password for authentication
378378
379379
380-
.. code:: ipython3
380+
.. code:: python
381381
382382
[(str(tweet.created_at_datetime), tweet.all_text, tweet.hashtags) for tweet in tweets[0:10]]
383383

0 commit comments

Comments
 (0)