gnip-insights

0.2.1 • Public • Published

gnip-insights

Gnip Insights is a NodeJS client for Gnip insights endpoints.

Methods

  • .get(url, callback)
  • .post(url, params, callback)

Usage example

const Gnip = require('gnip-insights');
const authConfig = {
    consumerKey: "YOUR_CONSUMER_KEY",
    consumerSecret: "YOUR_CONSUMER_SECRET",
    accessToken: "YOUR_ACCESS_TOKEN",
    accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET"
};

const gnipClient = new Gnip(authConfig);
const requestParams = {
  'tweet_ids': [
    '651523131308244993'
  ],
  'engagement_types': [
    'impressions',
    'engagements',
    'favorites',
    'replies',
    'retweets',
    'video_views'
  ],
  'groupings': {
    'types-by-tweet-id': {
      'group_by': [
        'tweet.id',
        'engagement.type'
      ]
    }
  }
};

gnipClient.post('insights/engagement/totals', requestParams)
  .then(response => {
    console.log(response);
  })
  .catch(console.log);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.1
    2
  • 0.2.0
    1
  • 0.1.0
    1

Package Sidebar

Install

npm i gnip-insights

Weekly Downloads

4

Version

0.2.1

License

MIT

Last publish

Collaborators

  • codingpains
  • manuelmhtr
  • voxfeed