Web Clipping from ANYWHERE workflow

This workflow lets you clip articles to markdown from any device that can add a bookmark to pinboard (OS X, Windows, iOS, Android, Windows Phone, and everything else).
It creates a multimarkdown file of articles bookmarked in pinboard with tag 2md. It creates them in a dropbox folder that you can index in devonthink.

Benefits: I like to be able to go through my rss feeds and twitter stream on my iPhone and iPad and clip stuff I think is interesting. Doing this on the computer isn’t nearly as much fun. Also, this has no need of Devonthink-to-Go.

This workflow assumes a working knowledge of IFTTT and Hazel.

Inspired by (and segments of code used from) this post by Brett Terpstra. What I’m doing in this post is very similar to what he does, but my version uses pinboard instead of pocket.

### OVERVIEW ###

# Step 1 - Bookmark to Pinboard
Bookmark a blog post or article and tag it ‘2md’. Put an excerpt in the description if you’d like. Make sure the bookmark is ‘public’.

# Step 2 - IFTTT rule creates text file in dropbox from pinboard bookmark
This isn’t the final markdown file, it doesn’t have the contents of the article. A DIFFERENT file (the markdown file) will be created in step 3.

# Step 3 - Hazel runs script on newly created dropbox file to create multimarkdown file of article. Example resulting file (identical to clipping as markdown with “Reformat with Readability” enabled with the Devonthink Web Clipper with the addition of a multimarkdown header and optional excerpt on top).
This is accomplished using Brett Terpstra’s amazing heckyesmarkdown.com.


### SETUP ###

# Step 1 - Create folders in dropbox:

  • urls2md
  • articles

urls2md is a processing folder
articles is the final destination for markdown files.

# Step 2 - Create an IFTTT rule:
Photo of IFTTT rule
IFTTT rule
Set it so the resulting text file is saved in the ‘urls2md’ folder.

# Step 3 - Setup Hazel rule:
Setup a hazel rule to look for the new text file created by IFTTT in your ‘urls2md’ folder.

Embedded script (embedded into hazel rule):


/usr/bin/ruby "/Users/david/Dropbox/bin/messxbin/scripts/urls2md.rb" "$1"

Ruby script (the one that’s referenced in the embedded hazel script):

Note: the original text file created by ifttt is moved to another folder (originals), so it doesn’t keep running the rule over and over.

# Step 4 - Index Folder in Devonthink
Index ‘Articles’ dropbox folder in Devonthink.


### NOTES ###

  • Tags created in IFTTT are converted to OS X tags which is awesome. (OpenMeta CLI required.)
  • ‘Description’ field in pinboard is added as a block quote to the top of the markdown file which is also awesome.
  • The pinboard bookmarks have to be public in order to be picked up by IFTTT.
  • If you have a computer running, this all happens in real time. If not, the articles will be added when you open your computer and dropbox can update and hazel can run.
  • There’s a few other things I have hazel do, like clean up the file names (remove underscores and such), and add date stamp to filename. If you know how to use Hazel, you can figure out how to do this.

This is really excellent!! Eric should give you a shout out on his blog for your contribution.

I think you can avoid the two-folder solution with Hazel if you use this condition

Great thought Korm!
I’ve also done it where instead of moving the file, it adds a color label and I change the rule to match only text files without the color label. Definitely a few different ways to avoid the rule from continuously running on the same file.
Man, Hazel is amazing.

For the life of me I cannot get this to work. I changed my target folder in the script yet Hazel still throws up an error. Is this still working for anyone?

Could you post more info – what was the error message? Have you checked the Hazel forum for help on the Hazel error?