Created
September 30, 2021 08:47
-
-
Save shiona/afd5e9604d5e7f822f9b1ee044e9e499 to your computer and use it in GitHub Desktop.
Violentmonkey script that adds a link to threadreader into twitter
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 New script - twitter.com | |
| // @namespace Violentmonkey Scripts | |
| // @match https://*.twitter.com/*/status/* | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
| // @grant none | |
| // @version 1.0 | |
| // @author - | |
| // @description 11/6/2020, 11:19:39 AM | |
| // ==/UserScript== | |
| setTimeout(work, 1000) | |
| function work() | |
| { | |
| var thread_title = $("span:contains('Thread')") | |
| console.log(thread_title) | |
| if(thread_title.length == 0) { | |
| setTimeout(work, 1000) | |
| } | |
| else { | |
| thread_id = window.location.pathname.split('/').pop() | |
| var thelink = $('<a>',{ | |
| text: ' [reader]', | |
| href: 'https://threadreaderapp.com/thread/'+thread_id+'.html'}) | |
| thread_title.append(thelink) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment