NetNewsWire to FriendFeed

nnw-to-ff.pngAfter building an applescript to post items from NetNewsWire to FriendFeed, I settled on using FriendFeed’s own bookmarklet from within NetNewsWire. Here’s the how and why.

I’ve been using NetNewsWire’s Clippings feature as a sort of light-weight alternative to posting links to my account. It makes for a one-click bookmarking experience, without having to wait for the tagger to load. I still use to save links that I’ll want to reference later, or that I want to send to someone (i.e. tagging it with for:username) since I don’t generally send links via email.

This tagless approach to bookmarking by way of the Clippings tool works pretty well most of the time. It generates an RSS feed, which these days is fairly easily re-mixable, and thus integrates into things like Feedheads in Facebook, and other places. Yet it is missing features, like being able to add a brief blurb, or allow others to comment.

Enter FriendFeed, which does have these features. However it doesn’t quite allow for the auto import of NetNewsWire’s clippings feed. It does import Google Reader’s shared items, but it sounds like a NNW to Google Reader sync is a long way off, at the least (though there does appear to be some workarounds). Hopefully the folks at FriendFeed will add NewsGator as a service soon, but for now NetNewsWire is pretty easy to script, and FriendFeed’s API can be used with a one line curl command. With that in mind, I started by adapting the existing “blogselection” script to post the current headline to FriendFeed.

set theFriendFeedUser to "YOURUSERNAME"
set theFriendFeedSecretKey to "YOURSECRETKEY" -- get it at
tell application "NetNewsWire"
  set theArticle to the selectedHeadline
  if theArticle is not false then
    set theText to the description of the theArticle
    set theLink to the URL of theArticle
    set theTitle to the title of theArticle
    set theBlog to the givenName of the subscription of theArticle
    set theBlogLink to the home URL of the subscription of theArticle
    do shell script "curl -u \"" & theFriendFeedUser & ":" & theFriendFeedSecretKey & "\" -d \"title=" & theTitle & "&link=" & theLink & "\""
  end if
end tell

Since I didn’t want to store the keys in the script, I adapted Andrew Faden and Larry Staton’s applescript to allow local storage of the user and api key.

Applescript is still kind of awkward, and to be able to allow the entry of a block of text was looking like more trouble than it would have been worth. I also couldn’t seem to find a solid set of documentation on NetNewsWire’s applescript hooks (perhaps my Google Fu failed me here – am I missing something, or is this just not well documented?).

After using the script for a bit, and feeling lukewarm about it, I realized that you can call a bookmarklet as a script in NetNewsWire. Could it be that easy? Turns out it is. All you need to do is copy the bookmarklet’s javascript (which can be done via a right click and a copy link location) into a .js file and paste it into a file to be saved in NetNewsWire’s scripts directory.

Now you have access to the Friendfeed bookmarklet and all it’s bells and whistles, which include being able to include images by clicking on them. Who needs a FFFFOUND! invite, when you have FriendFeed?

If you’re interested in the applescript, you can download or clone it from github.

One Comment