Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iyanuashiri/twitter-threader
A Twitter API library for threads
https://github.com/iyanuashiri/twitter-threader
tweepy twitter twitter-api twitter-bot
Last synced: 2 months ago
JSON representation
A Twitter API library for threads
- Host: GitHub
- URL: https://github.com/iyanuashiri/twitter-threader
- Owner: iyanuashiri
- License: mit
- Created: 2020-09-17T22:33:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T13:37:32.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T07:28:18.856Z (3 months ago)
- Topics: tweepy, twitter, twitter-api, twitter-bot
- Language: Python
- Homepage: https://github.com/iyanuashiri/twitter-threader
- Size: 55.7 KB
- Stars: 17
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twitter-threader
## Introduction
Twitter Thread is a library to manage threads on Twitter. You can GET and POST threads on Twitter.
## Installation
```bash
pip install twitter_threader
```## Usage
### GET a thread on Twitter
```python
from twitter_threader.threader import connect_api, Threadconsumer_key = 'CONSUMER_KEY'
consumer_secret = 'CONSUMER_SECRET'
access_token_key = 'ACCESS_TOKEN'
access_token_secret = 'ACCESS_TOKEN_SECRET'api = connect_api(consumer_key, consumer_secret, access_token_key, access_token_secret)
thread = Thread(api)
thread.convert_to_post('1247616218153902080')
```### POST a thread on Twitter
```python
from twitter_threader.threader import connect_api, Threadconsumer_key = 'CONSUMER_KEY'
consumer_secret = 'CONSUMER_SECRET'
access_token_key = 'ACCESS_TOKEN'
access_token_secret = 'ACCESS_TOKEN_SECRET'api = connect_api(consumer_key, consumer_secret, access_token_key, access_token_secret)
thread = Thread(api)
username = 'YOUR USERNAME'
thread.post_thread(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Metus dictum at tempor commodo ullamcorper a lacus. Amet justo donec enim diam vulputate. Sit amet justo donec enim diam vulputate ut pharetra sit. Leo duis ut diam quam. At ultrices mi tempus imperdiet. Mauris augue neque gravida in fermentum. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh. Placerat vestibulum lectus mauris ultrices eros in cursus turpis massa. In aliquam sem fringilla ut morbi tincidunt augue.',
username)```