I like tweeting about pages I read in the following format:
Most "share this" buttons add a lot of cruft and if there is none, it is annoying having to copy the text first and then the URL into Twitter.
With this bookmarklet, you can highlight some text, click the bookmarklet and get a tweet window in a new tab:
- We get the
anchorNodeof the current
- We check the type. If it's a text node, we read the
data, if it is HTML, we get the
- We open a window (which these days results in a new tab) and call the Twitter intend with the text followed by two linebreaks and the URL of the document.
Here's the minified version to add to your bookmarks:
Copy this, go to your bookmarks toolbar (change in view if it isn't visible), and set the location as the code above:
Voilà, happy tweeting.
Top comments (6)
Anyone got this working on Chrome (76.0.3809.100, Windows)? It does nothing when I then click on the bookmark.
Oops, there was a bug, I am editing this now. You can also drag the bookmarklet link on my blog into the chrome bar:
All working now, thanks and good work :)
I suffer the want thing when I want to share stuff.
Giving this a shot
Text is not inserted in Chrome. I think that the url changed to twitter.com/compose/tweet .
this work for me: