Socket
Socket
Sign inDemoInstall

tweetlib

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tweetlib

A python twitter scraper with no-api keys required.


Maintainers
1

Readme

Twitter Scraper

A python twitter scraper with no-api keys required.

Installation

pip3 install tweetlib

How to use it

All these parameters can be used in combination with one another.

ts = tweetlib.TweetLib(username="barackobama", max_tweets=10)

Arguments

  • username(str): any valid twitter name you want to scrape
  • since("yyyy-mm-dd"): A lower bound date to restrict search.
  • until("yyyy-mm-dd"):An upper bound date to restrict search.
  • query_search(str): Search string
  • max_tweets(int): Max number of tweets you want to scrape.

Examples

    from tweetlib import tweetlib
    # Get tweets by username
    ts = tweetlib.TweetLib(username="barackobama", max_tweets=10)
    tweets = ts.get_tweets()

    # Search for tweets
    ts = tweetlib.TweetLib(query_search="college", since="2018-01-01")
    tweets = ts.get_tweets()

Tweet Object

The tweet objects it returns in the list contain the following:

tweet = {
    id (str)
    permalink (str)
    username (str)
    text (str)
    date (date)
    replies (int)
    retweets (int)
    favorites (int)
    mentions (str)
    hashtags (str)
}

Credit and Contact

Created by Wyatt Ferguson

For any comments or questions your can reach me on Twitter @wyattferguson or visit my little portfolio at wyattf.dev

FAQs


Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc