/tweetblogpost

Extracts title/URL from a blog post and opens a Tweet box with the title/URL pre-filled

Primary LanguageJavaScriptMIT LicenseMIT

tl;dr

Grabs the current (WordPress) blog's post title and URL and puts them in a Tweet box.

About

This mostly replicates WordPress's missing auto sharing functionality which disappeared after the owner of Twitter dramatically increased API prices.

Tested in Safari 16.4 for macOS. Probably works in other browsers, but I haven't tested.

Getting Started

  1. Copy and paste tweetblogpost.js code above to new bookmarklet
  2. Go to the latest post in your blog, for example https://WWW.EXAMPLE.COM/####/##/##/TITLE/
  3. Click the bookmarklet in your browser

Prerequisites

A browser with JavaScript enabled, and a blog. Only tested with WordPress.

Known Bugs

  • None at this time

Potential Improvements

  • More flexible title extraction that supports more than just WordPress. (you can modify this by updating h1.entry-title (on line 3) for your blog)
  • Turn into an extension that detects when post is being published and automatically tweets

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/ulysseskan/tweetblogpost