Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twitterspawn

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitterspawn

Asynchronous, concurrent requests to the Twitter REST API, that respect Twitter's rate limits, using gevent and requests.

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

Twitterspawn

Asynchronous, concurrent requests to the Twitter REST API, that respect Twitter's rate limits, using gevent and requests.

See example.py for a working example.

Usage

Basically:

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 for a working example.

Installation

Simply:

$ pip install twitterspawn

Contact

@steveWINton.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc