poshdelicious

For those of you who don't know what Delicious.com is (yes it's the same as del.icio.us), I'll just borrow their overview from their getting started page:

Delicious is a social bookmarking service that allows you to tag, save, manage, and share Web pages all in one place.  With emphasis on the power of the community, Delicious greatly improves how people discover, remember and share on the Internet.

Here on DevCentral, when new content is added, we regularly add it to various social networking sites, including Delicious.  There are some great browser plugins that help you with sharing content and I regularly use the Shareaholic Firefox plug-in.  But, it's still too much manual work for me so I figured I'd try to automate it a bit.

I previously published a PowerShell library for Twitter (PoshTweet), for TwitPic (PoshTwitPic) as well as one for the Bing Search API (PoshBing) so I figured I'd build on those and write one for Delicious.  The Delicious API documentation is defined here

The API is broken down into the following functions:

Credentials

  • Set-Delicious.Credentials - set the client credentials for the delicious.com account.
  • Get-Delicious.Credentials - get the client credentials for the delicious.com account.

Posts

Tags

Tag Bundles

Usage:

The usage is fairly straight forward.  First you must load the functions into your runspace.  This is most easily done by "dot sourcing" the script.  Then you will call the Set-Delicious.Credentials function with your delicious credentials.  At this point you should be all set to submit bookmarks with PowerShell.  The following code creates a new bookmark for my blog with the Add-Delicious.Post function and then retrieves the entries from the last day you posted with Get-Delicious.Posts.

PS C:\> . .\Posh-Delicious.ps1
PS C:\> Set-Delicious.Credentials -user "joeuser" -pass "joepass"
PS C:\> Add-Delicious.Post -url "http://devcentral.f5.com/weblogs/joe" -extended "An awesome blog!" -tags "weblogs"
ResultCode
----------
done
PS C:\> Get-Delicious.Posts
href : http://devcentral.f5.com/weblogs/joe
hash : ed2760db92010aad2c6a1008afa6ce2b
description : http://devcentral.f5.com/weblogs/joe
tag : weblogs
time : 2009-09-21T15:34:06Z
extended : An awesome blog!

Get The Source

If you want to automate the posting of links to Delicious, feel free to check out the source that can be downloaded from here: Posh-Delicious.ps1

Enjoy!

-Joe