dimdenGD / YeahTwitter

Adds Yeah! button to Twitter, essentially a public Like
214 stars 9 forks source link

Yeah! for Twitter

Extension that adds a "Yeah!" button to Twitter. Essentially, it's a public Like button. It doesn't send spammy images into replies, instead it saves your Yeahs into a shared database. Everyone can see who Yeahed a tweet, and what tweets person Yeahed.
This extension supports both new Twitter and OldTwitter!
Screenshot

Installation

Chrome, Edge, Opera, Brave, Vivaldi, etc:
Chrome Web Store

Firefox, Waterfox, LibreWolf, Floorp, etc:
Firefox Add-ons

Userscript (Tampermonkey, Greasemonkey, Violentmonkey, etc):

UserscriptUserscript

Manual Installation

  1. Go to Releases page.
  2. Download chrome.zip if you're on Chromium based browsers (Chrome, Edge, Opera, Brave, etc.) or firefox.zip if you're on Firefox.

Chromium

Firefox

Firefox Developer Edition / Nightly

API

If you wish to implement Yeah! button in your Twitter mod, you can use this API.
Base URL: https://yeah.dimden.dev
All requests use POST method.
All requests require Content-Type: application/json.

Request Token - /api/request_token

Returns { public_token: String, private_token: String }.
You need to make user tweet yeah-xxxxxxxx where xxxxxxxx is public token.

Verify Token - /api/verify_token

Requires body: { public_token: String, private_token: String, tweet: Tweet }.
Tweet is object of this format. Must also include user object inside with id_str.
Will reply with success if everything went correctly. After that you can save private_token somewhere to use in other requests.

Get Yeah data for tweets - /api/get

Requires body: { post_ids: String, key: private_token }.
post_ids is string of tweet IDs separated by comma. Max 100 tweets per request.
Will return [ { post_id: String, count: Number, yeahed: Boolean }, ... ].

Yeah a tweet - /api/yeah

Requires body: { post_id: String, key: private_token }.
Will reply with done if everything went fine.

Unyeah a tweet - /api/unyeah

Requires body: { post_id: String, key: private_token }.
Will reply with done if everything went fine.

Get users that Yeahed a tweet - /api/get_users

Requires body: { post_id: String, key: private_token, page: Number }.
page starts with 1.
Will return an array with user ids.

Get tweets that user Yeahed - /api/get_yeahs

Requires body: { user_id: String, key: private_token, page: Number }.
page starts with 1.
Will return an array with tweet ids.

Get how many tweets user Yeahed - /api/get_user_yeah_count

Requires body: { user_id: String, key: private_token }.
Will return { count: Number }.