You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/twitter/README.md
+88-79Lines changed: 88 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,88 +3,97 @@
3
3
The Twitter plugin is a lightweight wrapper over commonly-used twitter API calls. It can be used as a executable on its own or by combining multiple of these into an executable.
4
4
5
5
## Installation
6
+
6
7
From this directory (`twitter`), run the installation:
8
+
7
9
```bash
8
10
poetry install
9
11
```
10
12
11
13
## Usage
12
-
1. Choose one of the 2 options to initialise the Twitter plugin
13
-
-`GameTwitterPlugin`
14
-
- This allows one to leverage GAME's X enterprise API credentials (i.e. higher rate limits)
15
-
-`TwitterPlugin`
16
-
- This allows one to use their own X API credentials
17
-
2. Initialise plugin objects, run set-up scripts and use plugin functions
18
-
-`GameTwitterPlugin`
19
-
- To get the access token to us this plugin, run the following command
20
-
```bash
21
-
poetry run twitter-plugin-gamesdk auth -k <GAME_API_KEY>
You can refer to `examples/test_game_twitter.py` for more examples on how to call the twitter functions. Note that there is a limited number of functions available. If you require more, please submit a feature requests via Github Issues.
58
-
59
-
- `TwitterPlugin`
60
-
- If you don't already have one, create a X (twitter) account and navigate to the [developer portal](https://developer.x.com/en/portal/dashboard).
61
-
- Create a project app, generate the following credentials and set the following environment variables (e.g. using a `.bashrc` or a `.zshrc` file):
62
-
- `TWITTER_API_KEY`
63
-
- `TWITTER_API_SECRET_KEY`
64
-
- `TWITTER_ACCESS_TOKEN`
65
-
- `TWITTER_ACCESS_TOKEN_SECRET`
66
-
- Import and initialize the plugin to use in your worker:
67
-
```python
68
-
import os
69
-
from twitter_plugin_gamesdk.twitter_plugin import TwitterPlugin
70
-
71
-
# Define your options with the necessary credentials
72
-
options = {
73
-
"id": "test_twitter_worker",
74
-
"name": "Test Twitter Worker",
75
-
"description": "An example Twitter Plugin for testing.",
post_tweet_fn(text="Hello world! This is a test tweet from the Twitter Plugin!")
93
+
```
94
+
95
+
For detailed documentation on each function's parameters and usage, please refer to the [Tweepy Client Documentation](https://docs.tweepy.org/en/stable/client.html).
96
+
97
+
Example usage:
98
+
99
+
You can refer to the example files in the `examples` directory for more examples on how to call the twitter functions.
0 commit comments