/twt-circle

A guide project on how to make interaction circles for Twitter

Primary LanguageJavaScriptMIT LicenseMIT

Example

Twt Circle

Originally from Twopcharts (and this repo forked from duiker101) it has been making the round in the dev community. I believe this is a great opportunity for a project to learn from. The concept is easy and straightforward but the realization encompasses a lot of concepts.

You can read more about the realization of this project on the HackerTyper Blog.

Installation

git clone https://github.com/harshit-budhraja/twt-circle.git
cd twt-circle
npm install

Run with

node src/index.js

You can also generate a text version of the image with the complete list of the presented users with the following command

node src/index.js --text

The output will go in users.txt file in the root of the project

Setup

To use the project you will need Twitter API keys. You can get one on the developer portal.

As this project uses only public data, you don't need an authorization key, but you can generate a Bearer Token. This will prevent you from fetching any private data but will grant you slightly higher rate limiting.

More information about Twitter's bearer tokens can be found here

Once you have your consumer keys, rename the .env.example file .env and put them in there, it should look like this:

CONSUMER_KEY=AAAA
CONSUMER_SECRET=BBBBBB

Make sure you don't have spaces.

Modifications

I, harshit-budhraja, have done some modifications to the code to make it run.

Challenges

You can try to apply the following changes to test your knowledge:

  • Apply a shade to each avatar based on the most common type of interaction
  • Fetch the circles for another user
  • Render a grid instead of the circles