Skip to content

Instantly share code, notes, and snippets.

View TheEssem's full-sized avatar
🔊
audio is cool shoutouts to audio

Essem TheEssem

🔊
audio is cool shoutouts to audio
View GitHub Profile
@TheEssem
TheEssem / rtpin.js
Created October 10, 2019 16:18 — forked from twilight-sparkle-irl/rtpin.js
pin retweets on twitter
$(document).ajaxComplete((e, x, o) => {
if (o.url == "https://api.twitter.com/1.1/statuses/retweet.json") {
tweet_id = JSON.parse(x.responseText)['id_str'];
auth_token = JSON.parse(document.querySelector('#init-data').value)['formAuthenticityToken'];
fetch("https://twitter.com/i/tweet/pin", {
body: `authenticity_token=${auth_token}&id=${tweet_id}`,
method: "POST",
headers: {
Accept: "application/json, text/javascript, */*; q=0.01",
"Cache-Control": "no-cache",