IndieWeb Press This bookmarklets for WordPress

One big IndieWeb raison d’Γͺtre is using your own web site to reply, like, repost, and RSVP to posts and events. You do this by annotating links on your site with simple microformats2 HTML.

Having said that, most people don’t want to write HTML just to like or reply to something. WordPress’s Press This bookmarklets can already start a new post with a link to the page you’re currently viewing. This code adds IndieWeb microformats2 markup to that link. Combined the wordpress-webmention plugin, you can use this to respond to the current page with just two clicks.

What’s more, if you’re responding to a Facebook post or Twitter tweet, this adds the Bridgy Publish link so you’ll reply, like, favorite, retweet, or even RSVP inside those social networks too.

The easiest way to set this up is to install the wordpress-indieweb-press-this plugin.

Alternatively, you can add it to directly to your theme by putting press_this.js in your theme directory and adding this to your theme’s functions.php file:

function indieweb_press_this_js() {
    wp_enqueue_script('indieweb-press-this', get_stylesheet_directory_uri() . '/press_this.js', false, '1.0', true);
}
add_action('admin_print_scripts-press-this.php', 'indieweb_press_this_js');

Finally, create bookmarks in your browser for the bookmarklets below (they require WP 4.2), then edit them and replace YOUR_SITE with your site’s domain (and the path to your admin console, if it’s not /wp-admin).

Also on IndieNews.

15 thoughts on “IndieWeb Press This bookmarklets for WordPress

  1. This is great, however I noticed that the link used is https so it didn’t work at all at first. I changed this to http:// and still ended up with a 404 error when I tried to do a reply. Any configuration of the module or steps I might be missing?

  2. hey jason, thanks for trying it! and sorry for the trouble. the URLs inside the bookmarklets are indeed a bit specific to my setup. try changing the /w/wp-admin part of the path to just /wp-admin, or whatever your WordPress admin console path is.

    …having said that, i’d definitely recommend trying pfefferle’s plugin instead. it packages all this up nicely and generates the bookmarks with your site’s URLs correctly. good luck!

  3. Pingback: Jonathan Frei

  4. A few questions:
    The difference between the Repost, Like, and Reply bookmarklets is the class, correct?

    Why does the Press This bookmarklet use Reply instead of Repost?

    Is it possible to have the bookmarklets not include a title?

    When I use any of these, should I expect to see my reply, repost, like appear on the replied-to, liked, or reposted post? (I’m guessing that this happens only on sites that have webmention enabled, correct?)

    If I replied to this post via the reply bookmarklet, will it appear here?

    Thanks!

  5. hey doug, glad you’re interested! let’s see…

    • one difference between the bookmarklets is the mf2 class, yes, but they also generate different body text and other details.
    • by Press This bookmarklet, do you mean the built in WordPress bookmarklet? I guess reply is just the default. I don’t use the default bookmarklet myself much.
    • omitting title is definitely possible! feel free to tweak the JS yourself, and even send a pull request.
    • correct, you’ll only see your response on the original site if it accepts webmentions. (this site does, so it would appear here!)
  6. Pingback: Kristen Savage

Leave a Reply

Your email address will not be published. Required fields are marked *