• Stars
    star
    108
  • Rank 311,194 (Top 7 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created about 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fun little experiment with Twitter API

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

More Repositories

1

Awesome-Black-Friday-Cyber-Monday

Awesome deals on Black Friday: Apps, SaaS, Books, Courses, etc.
1,721
star
2

github-explorer

Progressive Web Apps experiment
JavaScript
722
star
3

react-router-page-transition

Highly customizable page transition component for your React Router
JavaScript
542
star
4

logmine

A log pattern analyzer CLI
Python
141
star
5

chatgpt-prompt-templates

Templates for community prompts on TypingMind.com
47
star
6

tonydinh-com

My personal website
JavaScript
37
star
7

summer

Little fun experiment with cellular automaton
JavaScript
34
star
8

ChordDroid

Android library to render Guitar Chord.
Java
25
star
9

dinhquangtrung.net

My website
JavaScript
23
star
10

hn-big-threads

Use flame graphs to read very big HN threads
HTML
16
star
11

screensaver

Simple screensaver app
Shell
14
star
12

16-bit-computer

16-bit computer in Logism
JavaScript
13
star
13

smart-doge

Doge can find the next number in a sequence. Yay!
JavaScript
10
star
14

movie-showtimes

Web Service & Android Application to look up Vietnam movie showtimes
Java
7
star
15

nextjs-phaser

TypeScript
7
star
16

firebase-example

A web application to demonstrate Firebase features
JavaScript
6
star
17

8-bit-computer

8-bit-computer in Logism
JavaScript
5
star
18

do-an-xe

do-an-xe
JavaScript
4
star
19

960-grid-generator

Old school CSS grid generator (warning: float)
JavaScript
4
star
20

-VB6-VirusRemoveAll

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
3
star
21

snake-redux

Snake game with pure Redux and p5.js, no boilerplate
JavaScript
3
star
22

FreakingMathAndroid

Android game with numbers
Java
3
star
23

plain-react

My favorite boilerplate to create static web app with React.
JavaScript
3
star
24

thesimpleapi

API as a service
JavaScript
3
star
25

firebase-checkin

Check in application built with Firebase
HTML
2
star
26

web-bluetooth

web-bluetooth
HTML
2
star
27

facebook-float-video

Floating facebook video
JavaScript
2
star
28

vnk-swift

Vietnamese input method for OSX
Swift
2
star
29

-VB6-PerfectAntivirus

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
2
star
30

-VB6-SystemReporter

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
2
star
31

-VB6-ProcessManager

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
1
star
32

-VB6-AllFileLocker

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
1
star
33

web-bluetooth-codelabs

web-bluetooth-codelabs
HTML
1
star
34

test-twitter-physic

JavaScript
1
star
35

FormulasTextBox

A control for .Net Winform Application to process Input with formulas like an Excel cell.
C#
1
star
36

school-revision-tool

Self-review tool for school exam.
JavaScript
1
star
37

progressive-web-app-demo

Small demo building Progressive Web Apps
JavaScript
1
star
38

chrome-dinosaur

I copied the source code from Chromium and edited it.
HTML
1
star
39

css-stuffs

My experiment works with css
CSS
1
star
40

-VB6-NeverAutorun

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
1
star
41

bricks

Coding challenge
JavaScript
1
star
42

-VB6-1Click

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
1
star
43

-VB6-ProStatus

See my article about this project: http://dinhquangtrung.net/blog/some-softwares-i-made
Visual Basic
1
star