The Composer bookmarklet

Update: Now there are multiple bookmarklets here.

By popular request, Composer has a bookmarklet. Heavily inspired by the WordPress “Press This” feature, it uses the same javascript. You’ll find it on the compose screen under the Submit button.

It works in the usual way. Add it to your bookmarks then click it on any page. If you select some text on the page before you click it, that text will also be copied into the compose screen for you.

Tech

With this change, the compose screen supports 4 new url arguments: body, s = text selection, t = page title, and u = page url, on the new target url http://composer.io/posts/add/b.

The bookmarklet runs its javascript magic and constructs a url that looks like this (all values are url encoded):
http://composer.io/posts/add/b?s=foo&t=bar&u=http://foo.bar/

The body argument was added so you can roll your own bookmarklet and combine whatever javascript variables you want in your own order. The body argument is used first, then the others are combined in the usual way and appended.

For example, this url will load a compose screen like:

I'm the awesome body
This is the text I selected
Title of Awesome http://awesome.tld/

If you do roll your own, please let us know in the comments below. 🙂

Leave a Reply

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

Fatal error: Uncaught Error: Call to a member function do_action() on array in /var/www/html/site/wp-includes/plugin.php:517 Stack trace: #0 /var/www/html/site/wp-includes/comment-template.php(2825): do_action('comment_form_af...') #1 /var/www/html/site/wp-content/themes/twentytwelve/comments.php(80): comment_form() #2 /var/www/html/site/wp-includes/comment-template.php(1623): require('/var/www/html/s...') #3 /var/www/html/site/wp-content/themes/twentytwelve/single.php(28): comments_template('/comments.php', true) #4 /var/www/html/site/wp-includes/template-loader.php(106): include('/var/www/html/s...') #5 /var/www/html/site/wp-blog-header.php(19): require_once('/var/www/html/s...') #6 /var/www/html/index.php(17): require('/var/www/html/s...') #7 {main} thrown in /var/www/html/site/wp-includes/plugin.php on line 517