There is a promotion in the Apple App Store at the moment, giving away 10 apps for free to mark the 5 year anniversary of the App Store's launch.
One of the apps there is Day One, which I had heard some good things about, so decided to give it a whirl. And I like it.
One thing that I thought would be useful was a bookmarklet to send web pages from Safari into Day One entries. I had a quick look, but couldn't find anything. So I had a stab at building one myself.
This is the Day One URL scheme;
|Open Day One||dayone://|
|Start an entry||dayone://post?entry="entry body"|
|Open Entries list||dayone://entries|
And this is a bookmarklet I had previously made to work with the Drafts app;
And it works- good start!
Taking the code from my Drafts bookmarklet to get the URL and page title gave me this;
Which also worked. So this is basically the same as my Drafts bookmarklet (but without the Actions to trigger).
I had a more complex Drafts bookmarklet which checks for selected text (only works on the iPad when the Bookmarks bar is visible - otherwise any text is deselected when you pull up the bookmarks menu) - switching the base URL gave me this (I've added line breaks to make it readabl here- you probably don't want them if you're using this bookmarklet yourself. Just copy/paste the code into a text editor and remove the line breaks so it is all on a single line.)
Which, to my surprise (once I had got rid of some stray commas and semicolons) worked!
With some text selected on a web page, this bookmarklet now opens Day One, creates an entry and populated it with the web page title (as a markdown link to the page URL) and any selected text in a blockquote HTML tag, and looks something like this;
It occurred to me that an app that plays so nicely with URL schemes (ie. sending things to other apps via their URL schemes) would probably have a scheme of its own for pulling things in. A little googling later and I found that you can; like this bookmarklet
Not a bad result at all - especially considering I managed to put it all together on my iPad on a 25 minute train journey.