Add doc for cursor's return_pages kwarg
This commit is contained in:
parent
0f64978a08
commit
db40a1c56c
1 changed files with 13 additions and 0 deletions
|
|
@ -49,6 +49,19 @@ Another example:
|
||||||
for result in results:
|
for result in results:
|
||||||
print(result['id_str'])
|
print(result['id_str'])
|
||||||
|
|
||||||
|
Items vs Pages
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
By default, the cursor yields one item at a time. If instead you prefer to work with entire pages of results, specify ``return_pages=True`` as a keyword argument.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
results = twitter.cursor(twitter.get_mentions_timeline, return_pages=True)
|
||||||
|
# page is a list
|
||||||
|
for page in results:
|
||||||
|
for result in page:
|
||||||
|
print(result['id_str'])
|
||||||
|
|
||||||
|
|
||||||
HTML for Tweet
|
HTML for Tweet
|
||||||
--------------
|
--------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue