JSPM

  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q53367F
  • License GPL-3.0

Access Twitter data without an API key.

Package Exports

  • scrape-twitter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scrape-twitter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

scrape-twitter Build Status npm version

🐦 Access Twitter data without an API key

This module provides command line interfaces to scrape: profiles, timelines, search and conversations.

It also exposes both streams and a promise returning function to help accessing Twitter in your own applications.

Example

$ scrape-twitter profile sebinsua
# ...

$ scrape-twitter timeline nouswaves
# ...

$ scrape-twitter conversation ctbeiser 691766715835924484
# ...

$ scrape-twitter search --query "from:afoolswisdom motivation" --type latest
# ...

$ scrape-twitter list nouswaves list
# ...

JSON interface plays nicely with CLI tools like jq, coreutils/gshuf and terminal-notifier

For example, a MOTD-like script might contain:

scrape-twitter timeline afoolswisdom | jq -r 'map(select(.text | contains("knowledge"))) | .[].text' | gshuf -n 1 | terminal-notifier -title "Knowledge (MOTD)"

Install

With yarn:

yarn global add scrape-twitter

With npm:

npm install -g scrape-twitter

API

new TimelineStream(username: string, { retweets: boolean, replies: boolean })

Create a ReadableStream<Tweet> for the timeline of a username.

new ConversationStream(username: string, id: string)

Create a ReadableStream<Tweet> for the conversation that belongs to a username and tweet id.

new ThreadedConversationStream(id: string)

Create a ReadableStream<Tweet> for the conversation that belongs to a tweet id.

new TweetStream(query: string, type: 'top' | 'latest')

Create a ReadableStream<Tweet> for the query and type.

new ListStream(username: string, list: string)

Create a ReadableStream<Tweet> for the username and list.

getUserProfile(username: string)

Get a Promise<UserProfile> for a particular username.