A simple NodeJS API which receives a t.co referrer link, and traces it back to the user and tweet.
Setting up your own installation of Twitlytics is easy.
Head over to apps.twitter.com and create a Twitter app. You need this so you can authenticate with the Twitter API and send requests.
Once created, go to "Keys and Access Tokens" and make a note of the Consumer Key (API Secret) and the Consumer Secret (API Secret). You'll also need to generate an Access Token and Access Token and secret.
To allow it to run on platforms like Heroku with no persistent disk, twitlytics-server uses GitHub Gists for persistent storage.
Create or login to your GitHub account, and head to your Personal access tokens. Generate a new token with a description of
something like "twitlytics" and be sure to click the checkbox to enable the gist
scope. Make a note of the key that's generated!
The quickest way to get started is to use Heroku. Click the button below, and their UI will walk you through the setup and will prompt you for the Twitter and GitHub details from the previous steps.
Assuming you've got an internet-facing server with Node.JS installed already, the basics of setup are;
git clone
this repository to your server- Install the dependencies by running
npm install
- Create a file named
.env
in the newly created directory with the following, being sure to replace each{SETTING}
TWITTER_CONSUMER_KEY={YOUR_CONSUMER_KEY}
TWITTER_CONSUMER_SECRET={YOUR_CONSUMER_SECRET}
TWITTER_ACCESS_TOKEN_KEY={YOUR_ACCESS_TOKEN_KEY}
TWITTER_ACCESS_TOKEN_SECRET={YOUR_ACCESS_TOKEN_SECRET}
GITHUB_ACCESS_TOKEN={YOUR_GITHUB_ACCESS_TOKEN}