1.0.0 • Published 8 years ago

giffer-adapter-twitter v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

giffer-adapter-twitter - An image grabber for twitter

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.

Authentication

enter your Twitter API credentials in the config.js file, see config.js.example

API

The Giffer Twitter Adapter has the following API:

new Adapter(endpoint, parameters, imageTypes)

Creates a new Adapter object

endpoint (required)

The following values can be provided:

parameters (required)

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.

imageTypes

Regexp String containing the images we want the Adapter to emit

Example:

'gif|jpe?g|png'

or

'gif'

Adapter.start()

Starts the Giffer Adapter

Adapter.stop()

Stops the Giffer Adapter

Example

Instantiating and starting

  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();

Listening to the gif event

  instance.on('gif', (url, metadata) => {
    console.log('image url', url);
    console.log('tweet source url', metadata.origin);
  });
1.0.0

8 years ago

0.9.0

8 years ago

0.8.1

8 years ago

0.8.0

10 years ago

0.7.2

10 years ago

0.7.1

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.4

10 years ago

0.5.3

10 years ago

0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago