Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/e-dard/twitter-archive
Simple CLI tool for archiving a user's entire Twitter feed.
twitter-archive
has two basic modes:
twitter-archive
fetches the entire JSON object associated with each tweet in a user's timeline, upto the maximum number of tweets Twitter will allow to be fetched (currently 3,200).
Take a look here to see what the schema of a tweet looks like.
twitter-archive
can optionally exclude retweets and @-mentions from the archived tweets.
You will need to create a new application for Twitter at https://apps.twitter.com/.
Make a note of the API Key
and API secret
.
You will also need to add yourself (your Twitter user) to the Application, which will then provide you with an Access Token
and an Access Token Secret
.
twitter-archive
will need these tokens either as environment variables or via a JSON
configuration file.
Environment variables are mapped as follows:
TWITTER_CONSUMER_KEY
Application API Key;TWITTER_CONSUMER_SECRET
Application API Secret;TWITTER_ACCESS_TOKEN
Access Token;TWITTER_ACCESS_TOKEN_SECRET
Access Token Secret;Alternatively you can provide a JSON file that looks like:
{
"consumer_key": "S",
"consumer_secret": "",
"access_token": "",
"access_token_secret": ""
}
By default twitter-archive
will look for a .taconfig
file containing this JSON object, from the directory you are running the program.
You can specify the location of this file with the -c
option.
Assuming you have the Go compiler on your machine:
go get github.com/e-dard/twitter-archive
twitter-archive
will then be available in $GOPATH/bin
, which you already have in your $PATH
, right?
twitter-archive
outputs to stdout
, so you're most likely going to want to redirect the output to a file.
Getting a fresh archive of a user's timeline:
$ twitter-archive ThisisPartridge
{...}
{...}
{...}
If you don't want to include @-mentions or retweets in the archive, i.e., you just want a user's first-person status updates:
$ twitter-archive -noat -nort ThisisPartridge
{...}
{...}
{...}
Twitter only lets you get at the last 3,200 of a user's tweet. Therefore to keep an archive of more than that you will need to regularly request the latest tweets for a user. The update mode allows you to do that:
$ twitter-archive -a /path/to/existing/archivefile
where archivefile
would be a file containing previously archived tweets.
twitter-archive
will read the most recent tweet in the archive to figure out what point it needs to fetch tweets upto.
It will also use the archive to determine the user that the timeline belongs to, hence why you don't need to provide the user
argument.
You will still need to manually provide the -noat
and -nort
options.
Let's say you only want the text from a user's tweets:
twitter-archive ThisisPartridge | json -ga -e "this.text = this.text.replace('\n', ' ')" text
This example relied on you having the json tool installed. Note that it replaces any line-breaks in tweets with a space, so that you guarantee to end up with each tweet on its own line.
FAQs
Unknown package
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.