Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
dstwitter is a module for simplifying data analysis and manipulation of twitter tweets and users. It integrates into dstools by adding functions to the dstools collection object. See the dstools documentation for some more information about the dstools module.
You will need access token key, access token secret, consumer key and consumer token to run the code.
const ME = 'MY_SCREEN_NAME';
require('dstwitter');//initialize twitter functions
start = require('dstools').Collection
.context('twitter',{ //context function sets the context twitter credentials
access_token_key:'FILL-IN',
access_token_secret : 'FILL-IN',
consumer_key: 'FILL-IN',
consumer_secret: 'FILL-IN'
});
//get followers and following IDs
let followers = start.followersIDs(ME);
let following = start.followingIDs(ME);
//some stats
console.log('followers:',followers.count());
console.log('I follow:',following.count());
console.log("Follow me that I don't follow back:", followers.drop(following).count());
console.log("Don't follow me back:", following.drop(followers).count());
//follow users that follow me (that I don't already follow)
followers
.drop(following) //ignore users I am already following
.follow(); //follow them
### create a word cloud of user tweets
start.tweets('SOME_SCREEN_NAME',10000)
.column('text').toLowerCase()
.terms().dropStopwords('term')
.sortDesc('count').head(50).wordCloud('term','count').save('word-cloud.html');
start.searchTweets('javascript react',10000,{result_type:'mixed'})
.filter((tweet)=>!tweet.text.startsWith('RT @'))//filter out retweets
.map((tweet)=>tweet.user)//get users of the tweets
.column('screen_name')//get their screen name
.do((names)=>console.log('screen names',names.join()));//print names after finish loading tweets
Install dstwitter using npm
npm install dstwitter
Documentation of the package is over here
MIT
FAQs
Simplify usage of twitter API
The npm package dstwitter receives a total of 3 weekly downloads. As such, dstwitter popularity was classified as not popular.
We found that dstwitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.