Skip to content

Commit 685ac3e

Browse files
authored
Merge pull request #122 from andypiper/docs-enhanced
docs: update references for OAuth 2.0 GA
2 parents 22841dd + 361ac52 commit 685ac3e

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

README.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-twitter
22

3-
A simple Python wrapper around for Twitter API v2 :sparkles: :cake: :sparkles:.
3+
A simple Python wrapper for Twitter API v2 :sparkles: :cake: :sparkles:.
44

55
.. image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2
66
:target: https://developer.twitter.com/en/docs/twitter-api
@@ -32,9 +32,9 @@ This library provides a service to easily use this new version Twitter API.
3232
Documentation
3333
=============
3434

35-
You can get all api description and update at `Twitter API v2: Early Access <https://developer.twitter.com/en/docs/twitter-api/early-access>`_.
35+
You can get all API descriptions `Twitter API v2 Documentation <https://developer.twitter.com/en/docs/twitter-api>`_.
3636

37-
Library docs site on `here <https://sns-sdks.github.io/python-twitter/>`_
37+
Docs for this library on `here <https://sns-sdks.github.io/python-twitter/>`_
3838

3939

4040
==========
@@ -82,7 +82,7 @@ Using
8282

8383
The API is exposed via the ``pytwitter.Api`` class.
8484

85-
Now cover features:
85+
Now covers these features:
8686

8787
- Tweets
8888
- Tweet lookup
@@ -130,7 +130,7 @@ You can initialize with an bearer token:
130130
>>> from pytwitter import Api
131131
>>> api = Api(bearer_token="Your bearer token")
132132
133-
With user context token:
133+
With OAuth 1.0A user context token:
134134

135135
.. code-block:: python
136136
@@ -141,7 +141,7 @@ With user context token:
141141
access_secret="access secret"
142142
)
143143
144-
Or with authorize by user:
144+
Or with authorization done by user:
145145

146146
.. code-block:: python
147147
@@ -155,7 +155,7 @@ Or with authorize by user:
155155
'user_id': '123456',
156156
'screen_name': 'screen name'}
157157
158-
Twitter has `announcing OAuth 2.0 beta <https://twittercommunity.com/t/announcing-oauth-2-0-beta/159189>`_
158+
Twitter has `announced OAuth 2.0 user authentication support with fine-grained scopes <https://twittercommunity.com/t/announcing-oauth-2-0-general-availability/163555>`_
159159

160160
Now if you have app with ``OAuth2.0`` client ID. you can do authorize with ``OAuth2``.
161161

@@ -218,7 +218,7 @@ Get user followers:
218218
Response(data=[User(id='715131097332518912', name='Daniel', username='RGIDaniel'), User(id='1176323137757048832', name='Joyce Wang', username='joycew67')...])
219219
220220
221-
You can follow or unfollow user if you have OAuth 1.0a User context.
221+
You can follow or unfollow user if you have User context.
222222

223223
follow user:
224224

@@ -259,7 +259,7 @@ Get group of tweets:
259259
Streaming API
260260
-------------
261261

262-
For Streaming, this provide `StreamApi` independent. Same as main `Api`, You need initial it first.
262+
For Streaming, this provide `StreamApi` independent. Same as main `Api`, You need initialize it first.
263263

264264
.. code-block:: python
265265
@@ -269,13 +269,13 @@ For Streaming, this provide `StreamApi` independent. Same as main `Api`, You nee
269269
>>> stream_api = StreamApi(consumer_key="consumer key", consumer_secret="consumer secret")
270270
271271
272-
For Sample Stream tweets, You can use `sample_stream` function to build a connection.
272+
For Sample Stream tweets, you can use the `sample_stream` function to build a connection.
273273

274274
.. code-block:: python
275275
276276
>>> stream_api.sample_stream()
277277
278-
For Search Stream, You can point your rules.
278+
For Filtered Stream, you can create rules.
279279

280280
Get your current rules.
281281

@@ -284,7 +284,7 @@ Get your current rules.
284284
>>> stream_api.get_rules()
285285
Response(data=[StreamRule(id='1369580714056843266', value='twitter api ')])
286286
287-
Delete You rules.
287+
Delete your rules.
288288

289289
.. code-block:: python
290290
@@ -304,7 +304,7 @@ Add new rules. If you set `dry_run` to True, will only validate rules, and not c
304304
>>> stream_api.manage_rules(rules=np, dry_run=True)
305305
Response(data=[StreamRule(id='1370406958721732610', value='cat has:media -grumpy'), StreamRule(id='1370406958721732609', value='cat has:media')])
306306
307-
Then you can use `search_stream` to get tweets match your rules.
307+
Then you can use `search_stream` to get tweets matching your rules.
308308

309309
.. code-block:: python
310310

docs/docs/authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
At Twitter api, many endpoints use OAuth 1.0a method to act, or make API requests, on behalf of a Twitter account. For example, if you have a Twitter developer app, you can make API requests on behalf of any Twitter account as long as that user authenticates your app.
1+
Many endpoints currently use OAuth 1.0a method to act, or make API requests, on behalf of a Twitter account (but OAuth 2.0 with fine-grained scopes is preferred). For example, if you have a Twitter developer app, you can make API requests on behalf of any Twitter account as long as that user authenticates your app.
22

33
So, This will show you how to obtain user access tokens through the 3-legged OAuth flow.
44

@@ -51,5 +51,5 @@ Now the api instance will have the user authorization. You can use this to manag
5151

5252
!!! tip "Note"
5353

54-
If you have some confuse. you need to read the [Get user access token](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens) first.
54+
If you have any confusion, you need to read the [Get user access token](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens) first.
5555

docs/docs/authorization_oauth2.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
After `Sep 10, 2021`, Twitter has released a publicly available beta of our new OAuth 2.0 authorization protocol and fine-grained permission scopes.
2-
3-
If you are interested in shaping the future of OAuth 2.0 on the Twitter Developer Platform, can [request access](https://docs.google.com/forms/d/e/1FAIpQLSdUHe0KP5S05EAHLZooUL6Ze5TEBL4RNMUQcTauXKK-xuHMpQ/viewform) to the OAuth 2.0 beta.
4-
51
### Prerequisite
62

73
Once you have got the request access for `OAuth2.0`, your app will have the `Client ID` to do `authorization` for `OAuth2.0`.
84

9-
You can get more information at the [documentation](https://developer.twitter.com/en/docs/twitter-api/oauth2) and the [community content](https://twittercommunity.com/t/announcing-oauth-2-0-beta/159189).
5+
You can get more information at the [documentation](https://developer.twitter.com/en/docs/twitter-api/oauth2) and the [community content](https://twittercommunity.com/t/announcing-oauth-2-0-general-availability/163555).
106

117
If you're ready, now let's get started do a simple example with this library.
128

@@ -21,7 +17,7 @@ api = Api(client_id='your client id', oauth_flow=True)
2117

2218
!!! tip "Tips"
2319

24-
If your app is belong to `Confidential clients`. You need also provide `Client Secret`.
20+
If your app is a `Confidential client`, you need also provide `Client Secret`.
2521

2622
```python
2723
from pytwitter import Api
@@ -54,4 +50,4 @@ api.generate_oauth2_access_token(response="response", code_verifier="code_verifi
5450
# {'token_type':'bearer','expires_in':7200,'access_token':'access_token','scope':'users.read tweet.read','expires_at':1632852223}
5551
```
5652

57-
Now the api instance will have the user authorization. You can use this to manage apis need user authorization.
53+
Now the api instance will have the user authorization. You can use this to manage apis needing user authorization.

docs/docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ So this library provides a Python interface for this version API. Library work o
1111

1212
!!! tip "Tips"
1313

14-
This library only have apis for v2, not contains api for v1.1
14+
This library only has apis for v2, and does not contain api for v1.1
1515

1616

1717
## Thanks

0 commit comments

Comments
 (0)