{"id":128,"date":"2013-02-14T09:52:42","date_gmt":"2013-02-14T09:52:42","guid":{"rendered":"http:\/\/composer.io\/site\/?p=128"},"modified":"2013-10-04T11:31:55","modified_gmt":"2013-10-04T11:31:55","slug":"the-composer-bookmarklet","status":"publish","type":"post","link":"https:\/\/composer.io\/site\/2013\/02\/14\/the-composer-bookmarklet\/","title":{"rendered":"The Composer bookmarklet"},"content":{"rendered":"<p><strong>Update:<\/strong> Now there are multiple <a title=\"Composer.io Bookmarklets\" href=\"http:\/\/composer.io\/site\/features\/bookmarklets\/\">bookmarklets here<\/a>.<\/p>\n<p>By popular request, Composer has a bookmarklet. Heavily inspired by the WordPress &#8220;Press This&#8221; feature, it uses the same javascript. You&#8217;ll find it on the <a title=\"Composer has a bookmarklet\" href=\"http:\/\/composer.io\/posts\/add\">compose screen<\/a> under the Submit button.<\/p>\n<p>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.<\/p>\n<h2>Tech<\/h2>\n<p>With this change, the compose screen supports 4 new url arguments: <code>body<\/code>, <code>s<\/code> = text selection, <code>t<\/code> = page title, and <code>u<\/code> = page url, on the new target url <code>http:\/\/composer.io\/posts\/add\/b<\/code>.<\/p>\n<p>The bookmarklet runs its javascript magic and constructs a url that looks like this (all values are url encoded):<br \/>\n<code>http:\/\/composer.io\/posts\/add\/b?s=foo&amp;t=bar&amp;u=http:\/\/foo.bar\/<\/code><\/p>\n<p>The <code>body<\/code> 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.<\/p>\n<p>For example, this <a title=\"An example custom bookmarklet url\" href=\"http:\/\/composer.io\/posts\/add\/b\/?body=I'm the awesome body&amp;s=This is the text I selected&amp;t=Title of Awesome&amp;u=http:\/\/awesome.tld\/\">url<\/a> will load a compose screen like:<\/p>\n<p><code>I'm the awesome body<br \/>\nThis is the text I selected<br \/>\nTitle of Awesome http:\/\/awesome.tld\/<\/code><\/p>\n<p>If you do roll your own, please let us know in the comments below. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: Now there are multiple bookmarklets here. By popular request, Composer has a bookmarklet. Heavily inspired by the WordPress &#8220;Press This&#8221; feature, it uses the same javascript. You&#8217;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. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,38],"tags":[39,4,15,13],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-announcements","category-tech","tag-bookmarklet","tag-composer","tag-facebook","tag-twitter"],"_links":{"self":[{"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/posts\/128"}],"collection":[{"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":10,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/posts\/128\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/composer.io\/site\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}