Fun little experiment with Twitter API

Overview

Real-time Twitter Header

This is a fun little experiment with Twitter API. See my tweet!

CleanShot 2021-05-08 at 20 41 05@2x

How to setup for your Twitter

Just fill in your information in the emojiheader.js script.

const TWITTER_HANDLE = '@tdinh_me';
const credentials = {
  consumer_key: 'YOUR KEY HERE',
  consumer_secret: 'YOUR KEY HERE',
  access_token_key: 'YOUR KEY HERE',
  access_token_secret: 'YOUR KEY HERE'
};

To get the API keys, you need to apply for a Twitter Developer account. It's free and take ~5 minutes.

Lastly, change the default banner 1500x500.png or use the default one here. Make sure it's a png (as in the mimetype, not just the file extension).

PS: would be nice if you could leave the credit :P

Run the script

Install dependencies:

yarn

or

npm install

Note: if you are using an M1 MacBook, the image processing dependency may fail to install. Use another laptop or run it on a server.

Start the app:

node emojiheader.js

Keep it running and have fun!

How the script works

Read my thread here. Summary:

  1. Fetch your replies using Twitter API. (Rate limit: 180 requests per 15 mins)
  2. Filter the emojis from the text (not easy as it seems).
  3. Slap the emojis into the default banner (emoji images provided by twemoji).
  4. Update your profile banner using Twitter API. (Rate limit: 30 requests per 15 mins)

The script fetch new replies every 6 seconds (to avoid rate limit), then update the banner only if there are new emojis.

The delay between reply and banner update is between 6s to 15s.

Most importantly

Follow me on Twitter! https://twitter.com/tdinh_me

Thanks!

License

AGPLv3

You might also like...

Open game experiment with vehicles and physics in Three.js

TNTGame Open game experiment with vehicles and physics in Three.js You can try it online here: Crater scene: https://yomboprime.github.io/TNTGame/app?

Oct 5, 2022

Twitter-Clone-Nextjs - Twitter Clone Built With React JS, Next JS, Recoil for State Management and Firebase as Backend

Twitter Clone This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn de

Feb 7, 2022

Twitter-client - client for twitter-clone

Twitter (Client-Side Rendering) Please star this repo if you like ⭐ It's motivates me a lot! Getting Started This project was bootstrapped with Create

Jul 29, 2022

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Jan 8, 2023

Fuck Twitter NFTs - Userscript to delete or block all occurances of NFT Users on Twitter

FuckTwitterNFTs Fuck Twitter NFTs - Userscript to delete or block all occurances of NFT Users on Twitter Userscript will by default, attempt to delete

Jan 20, 2022

The Twitter bot that powers the hashtag #TechIsHiring on Twitter

TechIsHiring Twitter Bot The Twitter bot that powers the hashtag #TechIsHiring by liking and retweeting any tweet containing the hashtag. Technologies

Dec 23, 2022

Twitter bot to find what song is playing in a given uploaded twitter video.

Twitter bot to find what song is playing in a given uploaded twitter video.

what-song-is-this Twitter bot to find what song is playing in a given uploaded twitter video. How to setup. yarn install How to run. via npm script ya

Dec 11, 2022

A Twitter filtered search to only get the live broadcasts hosted on Twitter itself, Built using Vanilla JS and Node.js

Twitter Broadcasts Search A Twitter filtered search to only get the live broadcasts hosted on Twitter itself, Built using Vanilla JS and Node.js. Live

Oct 6, 2022

Animatelo is a bunch of cool, fun, and cross-browser animations for you to use in your projects. This is a porting to Web Animation API of the fabulous animate.css project.

Animatelo Just-add-water Web Animations Animatelo is a bunch of cool, fun, and cross-browser animations for you to use in your projects. Great for emp

Nov 12, 2022

SPOILER ALERT! A happy little bit of javascript to hide spoilers on your site.

SPOILER ALERT! Don't spoil it! Hide copy and images with a bit of SVG blur. Taste on mouseover. Eat on click. Do you publish spoilers? Do you wish you

Sep 27, 2022

Add a super simple rotating text to your website with little to no markup

#Super Simple Text Rotator by Pete R. A light weight jQuery plugin that will allow you to add a super simple rotating text to your website with little

Dec 6, 2022

a little DSL that outputs JSON schema

kontur a little DSL that outputs JSON schema instruction on validating request body in koa using ajv and kontur overview import { compile, bool, int,

Nov 8, 2020

Styleguide generator is a handy little tool that helps you generate good looking styleguides from stylesheets using KSS notation

SC5 style guide generator Looking for a maintainer If you would like to maintain the project, create an issue and tell a few words about yourself. Sty

Sep 26, 2022

A little library that can be used for bursting particles effects on buttons and other elements

A little library that can be used for bursting particles effects on buttons and other elements

Particle Effects for Buttons Bursting particles effects for buttons. By Luis Manuel. Article on Codrops Demo Credits anime.js Basic usage The Particle

Jan 1, 2023

The cutest little WebSocket wrapper! 🧦

The cutest little WebSocket wrapper! 🧦

Sockette The cutest little WebSocket wrapper! 🧦 Sockette is a tiny (367 bytes) wrapper around WebSocket that will automatically reconnect if the conn

Jan 2, 2023

A simple little WordPress block that allows you add an SVG icon or graphic to your website.

A simple little WordPress block that allows you add an SVG icon or graphic to your website.

Jan 4, 2023

Cool little features for the ScoreSaber Rank Requests Page.

Cool little features for the ScoreSaber Rank Requests Page.

Rank Request Add-ons Cool little features for the ScoreSaber Rank Requests Page that took me way longer than it should have taken to create. Install G

Dec 19, 2021

A Discord bot library to make the development of a bot a little bit easier.

Discord Bot Framework (DBF) A basic Discord bot framework to allow for easier creation of bots. With this library, you can easily parse and handle com

Dec 23, 2021
Owner
Tony Dinh
Write code, save the world 🌍
Tony Dinh
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.

A powerful JavaScript library for interacting with the Discord API

Discord.js 21.6k Jan 5, 2023
Notion 3.4k Dec 30, 2022
100% web real-time audio experiment using smartphones as effect controller. (tech: Android Chrome + WebRTC + Web Audio API)

beez 100% web real-time audio experiment using smartphones as effect controller. (tech: Android Chrome + WebRTC + Web Audio API) The concept An Hive i

Gaëtan Renaudeau 34 Dec 16, 2022
An experiment to use Polymer based mixins with Lit.

Polylit An experiment to use Polymer based mixins with Lit. Setup npm install Run tests npm test Features The following features are included: ready()

Serhii Kulykov 4 Jul 30, 2022
An experiment in building a public facing personal knowledge web app with TiddlyWiki and Nodejs.

Maarfapad What is this? Maarfapad was my attempt at learning Expressjs back in 2016 while building a CRUD app to handle TiddlyWiki html files. It was

A.B. Samma 3 Mar 12, 2022
The design experiment for import.meta.glob from Vite.

vite-plugin-glob The design experiment for import.meta.glob from Vite. Motivations There are quite some scenarios that import.meta.glob wasn't conside

Anthony Fu 166 Sep 17, 2022
A community-led experiment to build better docs and helpful content :)

Website This website is built using Docusaurus 2, a modern static website generator. Installation $ npm Local Development $ npm start This command s

Battlesnake Official 9 Jan 1, 2023
A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI GPT-3.

GitHub Repo Recommendation Writer A simple CLI experiment that writes recommendation of GitHub repository/project in form of tweet. Powered by OpenAI

Viktor Bezdek 5 Jul 18, 2022
PHP-in-JS: a silly experiment

php-tag Write your PHP backend code right inside your frontend JavaScript code using tagged template literals: import { php } from "php-tag"; async f

Fatih Aygün 12 Nov 26, 2022
Experiment with motion blur website scrolling

Motion Blur Scrolling demo I've created this demo to see if it's possible to achieve more 'smooth' motion experience of scrolling and any other moveme

Adam Pietrasiak 29 Nov 30, 2022