InternalThe config object for configuring the Rettiwt instance.
Add a user as a member of a list.
The ID of the target list.
The ID of the target user to be added as a member.
The new member count of the list. If adding was unsuccessful, return undefined.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Adding a user with ID '123456789' as a member to the list with ID '987654321'
rettiwt.list.addMember('987654321', '123456789')
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Get the details of a list.
The ID of the target list.
The details of the target list.
If list not found, returns undefined.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Fetching the details of the list with the id '1234567890'
rettiwt.list.details('1234567890')
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Get the list of members of a tweet list.
The ID of target list.
Optionalcount: numberThe number of members to fetch, must be <= 100.
Optionalcursor: stringThe cursor to the batch of members to fetch.
The list tweets in the given list.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Fetching the first 100 members of the Twitter list with id '1234567890'
rettiwt.list.members('1234567890')
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Remove a member from a list.
The ID of the target list.
The ID of the target user to removed from the members.
The new member count of the list. If removal was unsuccessful, return undefined.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Removing a user with ID '123456789' from the member of the list with ID '987654321'
rettiwt.list.removeMember('987654321', '123456789')
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Makes an HTTP request according to the given parameters.
The requested resource.
The raw data response received.
import { FetcherService, ResourceType } from 'rettiwt-api';
// Creating a new FetcherService instance using the given 'API_KEY'
const fetcher = new FetcherService({ apiKey: API_KEY });
// Fetching the details of the User with username 'user1'
fetcher.request(ResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Get the list of tweets from a tweet list.
The ID of target list.
Optionalcount: numberThe number of tweets to fetch, must be <= 100.
Optionalcursor: stringThe cursor to the batch of tweets to fetch.
The list tweets in the given list.
import { Rettiwt } from 'rettiwt-api';
// Creating a new Rettiwt instance using the given 'API_KEY'
const rettiwt = new Rettiwt({ apiKey: API_KEY });
// Fetching the most recent 100 tweets of the Twitter list with id '1234567890'
rettiwt.list.tweets('1234567890')
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
The base service that handles all HTTP requests.