Delicious

Summary: Insert a delicious.com user's links or tags into PmWiki
Version: 2009-10-14
Prerequisites: PmWiki 2.0.beta25
Status: Stable
Maintainers: JonHaupt, overtones99
Discussion: Delicious-Talk
Users: (view? / edit)

Questions answered by this recipe

  • How can I include a tagroll or linkroll from delicious.com (formerly del.icio.us) in my wiki?
  • How can I include a tagometer badge or a network badge from delicious.com?

Description

delicious.com, the social bookmarking site, offers the use of javascript tagrolls and linkrolls to be used on blogs and other web sites. This script enables you to include those rolls in a PmWiki installation. In addition, the script allows you to include a "tagometer badge" showing how many times a page has been bookmarked using delicious.com, and offering the opportunity to save the page to the user's delicious.com bookmarks. It also includes a simple "network badge" which displays your account name, how many bookmarks you have, etc.

To use this feature, install the delicious.phpΔ script into the cookbook/ directory, then add an include_once("$FarmD/cookbook/delicious.php"); line to a local customization file.

The script can generate linkrolls (displaying some or all of your bookmarked links) and tagrolls (displaying some or all of your tags). The simplest linkroll can be created by using the markup (:linkroll user=foo:) where foo is the desired delicious username, creating a roll of 10 recent links. Similarly (:tagroll user=foo:) creates a complete tag cloud (not a list) of user foo. There are a variety of other arguments you can use to customize this per page; one can also define default parameters via $DeliciousBookmarkDefaults and $DeliciousTagDefaults (see below).

The simplest way to produce a tagometer badge or network badge is to simply type (:tagometer:) or (:deliciousbadge user=foo:), respectively.

The recipe is derived from the delicious.com help pages, specifically those related to tagrolls, linkrolls, tagometer, and network badges.

Linkroll, Tagroll, Tagometer Badge, & Network Badge Arguments:

For (:linkroll:)

  • user: delicious.com username (required)
  • number: the number of links you want to display (default: 10)
  • sort: recent or alpha (default: recent)
  • tags: Limit the linkroll by tag(s). Multiple tags use the syntax 'tag+tag'
  • icon: large, small, rss, or none (default: large)
  • title: text to display as a header (default: My Delicious Bookmarks) - due to a bug, please use title='my title' rather than title="my title"
  • showtags: true or false (default: false) - include the tags associated with each link
  • shownotes: true or false (default: false) - include the notes associated with each link
  • showname: true or false (default: false) - displays username at the bottom, with a link to user's delicious page
  • showadd: true or false (default: false) - displays link to add user to your delicious network

For (:tagroll:)

  • user: delicious.com username (required)
  • number: number of tags to display (default: empty / '')
  • sizerange: in the syntax '8-25', the lowest and highest text size used for display (default: 12-35)
  • title: text to display as a header (default: 'My Delicious Bookmarks')
  • sort: options are freq (frequency), count (number of links) or alpha (default: alpha)
  • flow: cloud or list (default: cloud)
  • color1/color2: color1 is the least frequent tag, color2 is the most frequent (colors are used on a gradient between color1 and color2). must use html colors, no # (aka like this: '000099')
  • counts: true or false (default: false) - include the frequency of each tag
  • showicon: true or false (default: false)
  • showname: true or false (default: false) - displays username at the bottom, with a link to user's delicious page
  • showadd: true or false (default: false) - displays link to add user to your delicious network
  • style: only option is style=none (default is empty) - this prevents delicious styling rules from being loaded for tagroll, and hence allows you to format tagrolls via >>right<< or other CSS calls that are otherwise overidden by the delicious formatting rules...

For (:tagometer:)

  • size: wide or tall (default: wide)
  • icon: true or false (default: true) - shows or hides delicious icon
  • timesSaved: true or false (default: true) - shows or hides # of times saved
  • graph: true or false (default: true) - shows or hides graph
  • tags: true or false (default: true) - shows or hides tag

If you'd rather just copy&paste from http://delicious.com/help/tagometer instead of using the recipe and it's various arguments, simply add something like the following to config.php before including the recipe:

$DeliciousTagometerFmt = 'yourjavascripthere';

For (:deliciousbadge:)

  • user: delicious.com username (required)
  • icon: medium, small, or none (default: medium)
  • bookmarkcount: true or false (default: true) - number of bookmarks you've collected
  • networkcount: true or false (default: true) - number of networks you belong to
  • fancount: true or false (default: true)- number of fans you have
  • showicon: true or false (default: true)
  • showname: true or false (default: true) - displays username at the bottom, with a link to user's delicious page

Again, if you'd rather just copy&paste from http://delicious.com/help/networkbadges instead of using the recipe and it's various arguments, simply add something like the following to config.php before including the recipe:

$DeliciousBadgeFmt = 'yourjavascripthere';

Defining Default Values

Default values for linkroll, tagroll, tagometer badges and network badges are already defined within the recipe, but you can define your own defaults in config.php via $DeliciousTagDefaults, $DeliciousBookmarkDefaults, $DeliciousTagometerDefaults, and $DeliciousBadgeDefaults. Just paste something like the following before including delicious.php:

  $DeliciousBookmarkDefaults = array(
	'number' => '30',
	'sort' => 'alph',
	'tags' => 'true',
	'user' => 'myUserName',
	'icon' => 'none',
	'title' => '',
	'showtags' => 'true',
	'shownotes' => 'false',
	'showname' => 'false',
	'showadd' => 'false'
  );


  $DeliciousTagDefaults = array(
	'number' => '',
	'sort' => 'alpha',
	'sizerange' => '12-35',
	'user' => '',
	'flow' => 'cloud',
	'title' => 'My Delicious Tags',
	'color1' => '87ceeb',
	'color2' => '0000ff',
	'counts' => 'false',
	'showicon' => 'false',
	'showname' => 'false',
	'showadd' => 'false'
  );


   $DeliciousTagometerDefaults = array(
	'size' => 'wide',
	'icon' => 'true',
	'timesSaved' => 'true',
	'graph' => 'true',
	'tags' => 'true'
   );


   $DeliciousBadgeDefaults = array(
	'user' => 'myAccount',
	'icon' => 'medium',
	'bookmarkcount' => 'true',
	'networkcount' => 'true',
	'fancount' => 'true',
	'showicon' => 'true',
	'showname' => 'true'
   );

CSS and Styling Example

Linkroll - It's possible to style the linkroll links in your CSS file. Info from delicious.com on this matter is available here, though their examples are spare and not well-explained. Below are some of the more commonly used CSS lines that enable one to define separate stylings for links, tags, and notes. Note that there are several more CSS classes defined than are notated here. In addition, feel free to comment out or delete the ones you don't need. Any items that you don't include will inherit the default styling of your page.

.delicious-banner, .delicious-banner a { font-size:12px; color:green; } /* style for title */
.delicious-link { color:blue; } /* color of each bookmark link */
.delicious-tag { color:red; } /* color of each tags */
.delicious-extended { color:yellow; } /* style for notes */
.delicious-even { background-color:none; display:block; } /* zebra (alternating) - EVEN */
.delicious-odd { background-color:#eee; display:inline; } /* zebra (alternating) - ODD */

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

  • 2009-10-14 - added style=none for tagrolls - removes default delicious formatting, allowing tagrolls to be formatted via CSS calls like >>right<<, etc...
  • 2009-10-05 - added more arguments (showadd, showicon, showname) to (:tagroll:). To prevent confusion, the Tagometer (which was originally called via (:deliciousbadge:)) is now called instead via (:tagometer:); (:deliciousbadge:) now refers to the Delicious Network Badge, which is now incorporated; both have various arguments. Renamed various variable names, and cleaned up the code a bit... overtones99
  • 2009-10-04: can now display notes via shownotes=true; added showadd for diplaying 'Add me to your nettwork' link, and showname to display username and link; revised (:deliciousbadge:) to permit arguments overtones99
  • 2009-10-03: re-uploaded supposed version of April 2009 (just guessing), as it appears November 2008 was what was still being offered above; fixed issue with 'title' not displaying; plus, added $DeliciousBookmarkDefaults and $DeliciousTagDefaults as SDVA's, for easy config.php declaration overtones99
  • April 2009 : Bug fixes; changed "label" to "title" in order to follow Delicious.com standards
  • November 2008 : Updated for change from del.icio.us to delicious.com; fixed bug in output for label=''
  • January 2007 (1.1) : Added the ability to include tagometer badges.
  • March 2006 (1.0) : Initial release

See Also

Contributors

Comments

See discussion at Delicious-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.