Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

twitterspawn is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
 
Links
Author
License
MIT

# Twitterspawn

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

System Message: WARNING/2 (<string>, line 10); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 10); backlink

Inline interpreted text or phrase reference start-string without end-string.

# Define callback (can define 1 per request) def callback(response, worker):

System Message: ERROR/3 (<string>, line 15)

Unexpected indentation.
print "Got", response, "from", worker

# Add requests + callbacks twitterspawn.add_request("https://api.twitter.com/1/users/show.json",

System Message: ERROR/3 (<string>, line 19)

Unexpected indentation.
dict(params=dict(screen_name="steveWINton")), callback)

System Message: WARNING/2 (<string>, line 21)

Block quote ends without a blank line; unexpected unindent.
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",

System Message: ERROR/3 (<string>, line 30)

Unexpected indentation.
access_token_secret="YOUR_FIRST_ACCESS_TOKEN_SECRET", consumer_key="YOUR_CONSUMER_KEY", consumer_secret="YOUR_CONSUMER_SECRET")

System Message: WARNING/2 (<string>, line 33)

Block quote ends without a blank line; unexpected unindent.
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")

System Message: WARNING/2 (<string>, line 37)

Definition list ends without a blank line; unexpected unindent.

# ...add as many more workers as required... twitterspawn.add_worker(access_token="YOUR_LAST_ACCESS_TOKEN",

System Message: ERROR/3 (<string>, line 39)

Unexpected indentation.
access_token_secret="YOUR_LAST_ACCESS_TOKEN_SECRET", consumer_key="YOUR_CONSUMER_KEY", consumer_secret="YOUR_CONSUMER_SECRET")

# Go! twitterspawn.go() ```

System Message: WARNING/2 (<string>, line 43); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 43); backlink

Inline interpreted text or phrase reference start-string without end-string.

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).

Subscribe to package updates

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.