Originally made to be used with the giffer download bot Giffer. This adapter can also be used standalone to grab gifs from the public twitter API endpoints.
enter your Twitter API credentials in the config.js
file, see config.js.example
The Giffer Twitter Adapter has the following API:
Creates a new Adapter object
The following values can be provided:
See Twitter Dev API
Object holding optional Twitter Stream API endpoint parameters. The Twitter Stream API endpoints can take a set of given parameters which can be found in the API documentation for each endpoint.
Regexp String containing the images we want the Adapter to emit
Example:
'gif|jpe?g|png'
or
'gif'
Starts the Giffer Adapter
Stops the Giffer Adapter
const instance = new Adapter({
endpoint: 'statuses/filter',
parameters: {
track: ['javascript', 'gifs', 'funny', 'images', 'pics'],
stall_warnings: true
},
image_types: '(gif|jpg|jpeg|png)'
});
instance.start();
instance.on('gif', (url, metadata) => {
console.log('image url', url);
console.log('tweet source url', metadata.origin);
});