Skip to content

Instantly share code, notes, and snippets.

View flyxed's full-sized avatar

flyxed

View GitHub Profile
@twilight-sparkle-irl
twilight-sparkle-irl / rtpin.js
Last active September 14, 2022 04:17
pin retweets on twitter ----> ----> !! YOU NEED TO BE ON THE OLD LAYOUT, GET GoodTwitter !! <---- <----
$(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",