Get all your twitter likes
npm install --global arnaudjuracek/twitter-get-likes
twitter-get-likes
twitter-get-likes username
twitter-get-likes username > my-likes.csv
twitter-get-likes username --json > my-likes.json
twitter-get-likes --help
twitter-get-likes --version
Options
-h, --help Show this screen.
-v, --version Print the current version.
--json Output tweets as a JSON object instead of CSV.
--schema Specify a custom CSV schema path.
NOTE: This tool does not provide file writing capabilities ; use stdout
redirection to write files.
Twitter API must be used with access tokens, which are passed to twitter-get-likes
cli using environment variables. See .env.example
.
You can specify your own CSV export schema using a simple JSON to JavaScript eval
implementation, where tweet
is an object containing the current tweet (as exposed when using the --json
flag):
$ twitter-get-likes @nodejs --schema="date-and-id.json"
date,id
Wed Mar 27 2019 18:43:04 GMT+0100 (CET),1110960442292256800
{
"date": "new Date(tweet.created_at)",
"id": "tweet.id"
}
Some additionnals options are available through environment variables, see .env.example
.
const getLikes = require('twitter-get-likes')
const options = {
credentials: {
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
},
count: 200,
endpoint: 'favorites/list',
maxRequests: Number.POSITIVE_INFINITY,
trimUser: false,
tweetMode: 'extended'
}
getLikes('nodejs', options)
.then(tweets => console.log(tweets))
.catch(error => console.error(error))