
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
twitter-request
Advanced tools
Twitter-Request is a module to make easy authentificated request to the Twitter API. (Only user-authentification is supported for now)
npm install --save twitter-request
var TwitterRequest = require('TwitterRequest');
var oauth = {
// Mandatory
consumer_key: "CONSUMER_KEY",
consumer_secret: "CONSUMER_SECRET",
// Optional
token: "USER_TOKEN",
token_secret: "USER_SECRET_TOKEN"
};
var treq = new TwitterRequest(oauth);
// Go to https://dev.twitter.com/docs/api/1.1 to have endpoints documentation
treq.request('statuses/update', {
// Add query to the url
query: {
'status': 'Hello Twitter ! I will destroy this tweet in 5 seconds c:'
}
}, function(err, res, body){
// err => ERROR
// res => ServerResponse
// body => Body of the response
if(err) throw err;
if(res.statusCode !== 200)
throw new Error('For some reason, Twitter reject the request D:\n\rMore information:\n\r' + JSON.parse(body));
setTimeout(function(){
treq.request('statuses/destroy', {
// Replace url parameters (statuses/destroy => https://api.twitter.com/1.1/statuses/destroy/:id.json [here, we replace the id parameters])
params: {
// Use id_str instead of id ! id may be to long for an integer
id: JSON.parse(body).id_str
}
});
}, 5000);
});
// Support of streaming api
var req = treq.request('statuses/filter', {
// Add data to the body
body: {
'track': 'nodejs'
}
});
req.on('data', function(data){
console.log(data.toString());
});
// You can find and rewrite oauth data here (This object is passed to the request oauth function)
console.log(treq.oauth);
treq.oauth.consumer_key = "NEW_CONSUMER_KEY";
FAQs
Request to the Twitter API
We found that twitter-request 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.