Skip to content

Instantly share code, notes, and snippets.

@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",
@traverseda
traverseda / si_markdown.py
Created January 28, 2015 11:31
For converting datapacrats weird syntax into common markdown.
import re,sys,tempfile
import markdown2
def emphasis(matchobject):
return("*{}*".format(matchobject.group(1)))
regexes=[
#Close enough
('/(?!/)(?<!//)(.+?)/',emphasis)