Created
April 22, 2022 13:26
-
-
Save Akkiesoft/8f3ef2ec1a590132b90e24a423b4cb5e to your computer and use it in GitHub Desktop.
override tweet button to the toot to mastodon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name birds gone somewhere | |
// @match https://twitter.com/intent/tweet* | |
// @version 0.1 | |
// @description override tweet button to the toot to mastodon. | |
// ==/UserScript== | |
var base = "https://social.mikutter.hachune.net/share?text="; | |
var url = location.href.split('?')[1].split('&'); | |
var twtext = ""; | |
var twurl = ""; | |
for (var i = 0; i < url.length; i++) { | |
var j = url[i].split('='); | |
if (j[0] == 'text') { | |
twtext = j[1]; | |
} | |
if (j[0] == 'url') { | |
twurl = "%0D%0A" + j[1]; | |
} | |
} | |
var newurl = base + twtext; | |
if (twurl) { newurl += twurl; } | |
location.href = newurl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment