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.
rettiwt-core
Advanced tools
A library for generating requests for Twitter API
Currently, generation of request configuration for the following resources/actions is supported:
The following examples will help you to get started with using the library:
import { Request } from 'rettiwt-core';
const request = new Request().user.detailsByUsername(user_name);
Where,
user_name
is the user name of the Twitter user whose details are to be fetched.import { Request } from 'rettiwt-core';
const request = new Request().tweet.likers(tweet_id, count, cursor);
Where,
tweet_id
is the 'rest_id' of the Tweet whose likes are to be fetched.count
is the number of likers to fetch.cursor
is the cursor to the batch of likers to fetch.import { Request } from 'rettiwt-core';
const request = new Request().tweet.search(
{
fromUsers: ['user_name_1', 'user_name_2'],
includeWords: ['word_1', 'word_2'],
},
count,
cursor,
);
Where,
user_name_1
, user_name_2
, .......... are the different usernames whose tweets are requried.word_1
, word_2
, ........... are the different words that must be in the tweets.count
is the number of tweets to fetch.cursor
is the cursor to the batch of tweets to fetch.Apart from this, other filters are also available (see here).
import { Request } from 'rettiwt-core';
const request = new Request().tweet.post({ text: 'text_to_tweet' });
Where,
text_to_tweet
is the text which you want to tweet.Uploading a media is a three step process. These three steps are:
import { Request } from 'rettiwt-core';
const request = new Request().media.initializeUpload(size);
Where,
size
is the size (in bytes) of the media to be uploaded.Sending this request allocates a media_id
to the media to be uploaded, which will be used for successive steps.
import { Request } from 'rettiwt-core';
const request = new Request().media.appendUpload(media_id, media_path);
Where,
media_id
is the ID allocated to the media by sending the previous request.media_path
is the path to the media to be uploaded.Sending this request uploads the media file to Twitter.
Notes:
ArrayBuffer
containing the media can also be uploadedimport { Request } from 'rettiwt-core';
const request = new Request().media.finalizeUpload(media_id);
Where,
media_id
is the ID allocated to the media uploaded using the previous reqeust.Sending this request finalizes the upload process of the media and makes the media ready to be included in Tweets, via the media's allocated ID.
import { Request } from 'rettiwt-core';
const request = new Request().tweet.post({
text: 'text_to_tweet',
media: [
{
id: 'id_1',
tags: ['user_id_1', 'user_id_2', 'user_id_3'],
},
{
id: 'id_2',
tags: ['user_id_4', 'user_id_5', 'user_id_6'],
},
],
});
Where,
In order to actually be able to send the generated requests, you need to authenticate them, by following the steps described here.
After generating the respective request configuration, the same can be used to make HTTP requests in order to access that specific resource.
For the complete API reference, go through the full documentation.
FAQs
A library for generating requests for Twitter API
The npm package rettiwt-core receives a total of 1,306 weekly downloads. As such, rettiwt-core popularity was classified as popular.
We found that rettiwt-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
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.