Asynchronous, concurrent requests to the Twitter REST API, that respect Twitter's rate limits, using [gevent](http://www.gevent.org/) and [requests](http://docs.python-requests.org/).
See [example.py](https://github.com/swinton/twitterspawn/blob/develop/example.py) for a working example.
## Usage
Basically:
```python
import twitterspawn
# Define callback (can define 1 per request)
def callback(response, worker):
print "Got", response, "from", worker
# Add requests + callbacks
twitterspawn.add_request("https://api.twitter.com/1/users/show.json",
dict(params=dict(screen_name="steveWINton")),
callback)
twitterspawn.add_request("https://api.twitter.com/1/users/show.json",
dict(params=dict(screen_name="twitter")),
callback)
twitterspawn.add_request("https://api.twitter.com/1/users/show.json",
dict(params=dict(screen_name="catbinlady")),
callback)
# Add workers
twitterspawn.add_worker(access_token="YOUR_FIRST_ACCESS_TOKEN",
access_token_secret="YOUR_FIRST_ACCESS_TOKEN_SECRET",
consumer_key="YOUR_CONSUMER_KEY",
consumer_secret="YOUR_CONSUMER_SECRET")
twitterspawn.add_worker(access_token="YOUR_NEXT_ACCESS_TOKEN",
access_token_secret="YOUR_NEXT_ACCESS_TOKEN_SECRET",
consumer_key="YOUR_CONSUMER_KEY",
consumer_secret="YOUR_CONSUMER_SECRET")
# ...add as many more workers as required...
twitterspawn.add_worker(access_token="YOUR_LAST_ACCESS_TOKEN",
access_token_secret="YOUR_LAST_ACCESS_TOKEN_SECRET",
consumer_key="YOUR_CONSUMER_KEY",
consumer_secret="YOUR_CONSUMER_SECRET")
# Go!
twitterspawn.go()
```
See also [example.py](https://github.com/swinton/twitterspawn/blob/develop/example.py) for a working example.
## Installation
Simply:
$ pip install twitterspawn
## Contact
@[steveWINton](https://twitter.com/steveWINton).
Metadata
Release files for twitterspawn 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| twitterspawn-0.2.0.tar.gz | 4.2 kB | Without provenance | Details for twitterspawn-0.2.0.tar.gz |
Release files / twitterspawn-0.2.0.tar.gz
| Download URL | twitterspawn-0.2.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
faebeb455dad5ee3219456f9bb7a60d3cbd8b62b8bf08771caaf83dbd0b83fd7
|
|
BLAKE2b-256 checksum How to use checksums |
dd24e1729cac92c32e4f946a90eb56b3ea4819e397f45576e7ce075f9c6a48a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for twitterspawn 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.