For my reading list: some links on Twitter bookmarklets
Posted by jpluimers on 2023/03/15
Yup, web browser bookmarklets, though hardly published about any more, I still like them (and wrote about them before). With a little bit, usually unreadable, JavaScript, they can add magical functionality to your browser.
So here are some links on Twitter related bookmarklets:
- [Wayback/Archive] Send to Twitter Bookmarklet (uses document.title and URL as content) with this URI:
javascript:location.href='http://twitter.com/share?url='+encodeURIComponent(window.location.href)+'&text='+encodeURIComponent(document.title)
which I reworked into:
javascript:window.open('http://twitter.com/share?url='+encodeURIComponent(window.location.href)+'&text='+encodeURIComponent(document.title))
- These are all from the same author:
All code from the above links seemed to give corrupted tweets, which I thought was because of quote beautification, but was just me doing the whitespace removal wrong.
This is the right one:
javascript:(function(){n=getSelection().anchorNode;if(!n){t=document.title;}else{t=n.nodeType===3?n.data:n.innerText;}t='“'+t.trim()+'”\n\n';window.open(`https://twitter.com/intent/tweet?text=${encodeURIComponent(t)}${document.location.href}`)})();
which I reworked using
«»
quotes into:javascript:(function(){n=getSelection().anchorNode;if(!n){t=document.title;}else{t=n.nodeType===3?n.data:n.innerText;}t='«'+t.trim()+'»\n\n';window.open(`https://twitter.com/intent/tweet?url=${document.location.href}&text=${encodeURIComponent(t)}`)})();
- [Wayback/Archive] A Couple of Quick Bookmarklets For Viewing a Suspended / Deleted Twitter User – ResearchBuzz with two “Twitter” jail search bookmarklets, of which I created a third (as Archive Today often saves tweets better than the WayBack Machine):
- Twitter jail Google Search cache:
javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("Please enter a Twitter handle", ""); if (q!=null) location="http://www.google.com/search?q=cache:https://twitter.com/" + escape(q).replace(/ /g, "+"); void 0
- Twitter jail WayBack Machine:
javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("Please enter a Twitter handle", ""); if (q!=null) location="https://web.archive.org/web/*/https://twitter.com/" + escape(q).replace(/ /g, "+"); void 0
- Twitter jail archive.today:
javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("Please enter a Twitter handle", ""); if (q!=null) location="https://archive.md/https://twitter.com/" + escape(q).replace(/ /g, "+"); void 0
- Twitter jail Google Search cache:
- [Wayback/Archive] A simple bookmarklet that searches Twitter with the URL you are on.
javascript:var u = window.location.protocol + '//' + window.location.host + window.location.pathname; var l = document.getElementsByTagName("link"); for (var i = 0; i < l.length; i ++) { if (l[i].getAttribute('rel') === 'canonical') {u = l[i].getAttribute('href')}}; window.open('https://twitter.com/search?q=' + encodeURIComponent(u) + '&src=paulmwatson');
- Finally, there is [Wayback/Archive] Twitter Publish, which has a complicated unclear set of user experience combinations for sending out various kinds of tweets.
Hopefully I will have sometime later to dig into these. The below links likely will get me started:
All via [Wayback/Archive] twitter bookmarklet – Google Search.
–jeroen
Leave a Reply