twitter-api-tools

Cool functions to use with twitter api

Usage no npm install needed!

<script type="module">
  import twitterApiTools from 'https://cdn.skypack.dev/twitter-api-tools';
</script>

README

Description

A Node Module with some cool features for interacting with the twitter API, using twitter-node-client

Installation

npm install twitter-api-tools
var Twitter = require('./twitterClient').twitterFunctions;

Usage

You will need to pass the API Config required for twitter-node-client in the constructor,

  //Get this data from your twitter apps dashboard thanks @BoyCook
  var config = {
      "consumerKey": "XXX",
      "consumerSecret": "XXX",
      "accessToken": "XXX",
      "accessTokenSecret": "XXX",
      "callBackUrl": "XXX"
  }

  twitter = new Twitter(config);

  //Returns an object mapping words used in all tweets to # of times used
  Twitter.getFrequencyObject('TwitterUsername', function(obj,error){
    console.log(obj,error);
  });

  //Returns all tweets from user's page going back to creation, in array
  Twitter.getAllTweets('TwitterUsername', function(arr ,error){
    console.log(arr,error);
  });