In: , , , , , ,
On: 2004 / 10 / 05
Shorter URL for this post: http://ozh.in/2v

I found a lot of ways and hacks to integrate your delicious links into a page, but I wanted to fetch all links for a given set of tags, not just mine, so I wrote my own hack : introducing taga.licio.us, yet another del.icio.us php hack !

Taga.licio.us is a tag filter for del.icio.us : it produces a page with links from selected tags, allows to integrate del.icio.us links for one or more tags into an existing page, limited to a specified "freshness" (links of the day ? of the hour ?), and comes with gazillions of options. If you are a WordPress user, it is also able to directly post into your database to, say, run the script daily at fixed hour and print links on a given subject right into your blog.

What for ?

I personnaly use del.icio.us as a starter for my click & browse session : on a given subject, ie tag, I find it a nice collection of more or less fresh links and I often find interesting sites. So I'm using the script as a delicious "digest" : filter all the unwanted tags off, display just what I want to read about and start surfing from there.

You can also integrate the resulting page into an existing one. Say for example you run a site about mp3 and games : you could print daily del.icio.us links on this subject. Effortless fresh content everyday :-P

Live example

Before we go on with my usual 40 page documentation, let's see the kind of results the script can output :

Etc … Easy digest of subjects that interest you, to browse from or to integrate into a page.

Ready for the installation guide & manual ? Let's go.

RSS PHP Parser of the Century Award : MagpieRSS

This hack is just a humble user of Magpier RSS, a PHP parser for RSS feeds that is truely powerful. So, first of all, you need to install it on your server. Just download the latest archive, unpack it anywhere on your site and you're done.

If it is possible, I'd recommend putting it beneath your document root (~/htdocs) along with all your shared libraries and stuff. But if not, really anywhere will do, and should someone access a file in their browser, it will have no output and no effect, so don't be afraid.

Get the script : taga.licio.us

The script comes in two flavors : one for anyone willing to integrate del.icio.us links into a php page, and one for WordPress users with a few extra abilities detailed below.

Note for WordPress users: although it may look like a plugin, this is not a plugin. This is a standalone script, don't put it in your wp-content/plugins directory or, to quote a source you may have read before, the sky will fall on your head.

Configure the script

Anyone could just stop reading now, since reading the script itself will be probably enough : as usual my "work" is heavily commented and options are detailed to death. I'm just posting everything here for further reference.

First are variables you'll find in both versions. WordPress specific ones will be found below in a, guess what, WordPress section.

Magpie stuff

require_once '/home/you/magpierss/rss_fetch.inc';
This is the physical path to your Magpie copy.
Note for windows users : put path like 'C:/myweb/magpierss/rss_fecth.inc' (regular slashes, not antislashes)

define('MAGPIE_CACHE_ON', 1);
Use MagpieRSS built-in cache feature : this is mandatory for the sake of courtesy. You don't want to fetch a file everytime someone reads your blog, so this parameter tells Magpie to use a cached copy.
To do so, you have to create a directory where your taga.licio.us script is, named "cache", and chmoded to something writable (0777 will do fine)
Note: If you want to cache RSS feeds in another directory, use the constant MAGPIE_CACHE_DIR (for more information, read the comments at the beginning of rss_fetch.inc in your Magpie directory)

define('MAGPIE_CACHE_AGE',3600);
Number of seconds before a file is considered old and you fetch a fresh one. One hour seems fair if you intend to integrate the output into your blog.

Fetching del.icio.us options

Now onto the real core of the options. As usual, all variables (and functions) start with "wp_ozh_deli", to prevent cross reference with another script.

$wp_ozh_deli_param['tags'] = "webdesign css";
Value : a space separated list of tags
Examples : 'mp3' for all links tagged with mp3, 'php python' for all links tagged with php, and all links tagged with python.
This can be overridden by the query string (?tags=php) as on the live examples above.
Note : Although you can actually read on del.icio.us links with 2 or more tags (blog+css+design for example) the associated feed is not correct. So passing a parameter like 'css+blog' won't break the script, but won't produce the wanted result.

$wp_ozh_deli_param['freshness'] = 86400;
Value : an integer, number of seconds for a link to be considered printable.
Typically, if you fetch the script every 24 hours using a cronjob, set it to 86400. A few reminders : 86400s = 24h, 43200s = 12h, 21600 = 6h, 3600 = 1h.

$wp_ozh_deli_param['maxitems'] = 0;
Value : an integer, maximum number of links per feed.
This setting overrides freshness is applicable. Set to 0 (zero) if you don't want to limit : in such a case, you may hit the del.icio.us feed number of items as a limit, set to 30.

Output options

Next variable has a multiline syntax, be careful when editing. Starts with a ' (single quote) and ends accordingly

$wp_ozh_deli_param['post']

  1. $wp_ozh_deli_param['post'] = '
  2. Taga.licio.us : %%COUNT%% links from <a href="http://del.icio.us/">del.icio.us</a>,
  3. on the subject of <em>%%TAGS%%</em> :
  4. <ol class="delicious">
  5. %%LINKS%%
  6. </ol>';

Value : some html code.
Note the use of 3 "templates variables" :

  • %%COUNT%% will be replaced by the number of links fetched
  • %%TAGS%% will be replaced by the list of tags you picked in a readable format, for example : "mp3, music and audio"
  • %%LINKS%% will be replaced by the links, as defined by the next parameter

$wp_ozh_deli_param['pattern']

  1. wp_ozh_deli_param['pattern'] = '
  2. <li style="list-style-type: decimal-leading-zero;">
  3.  <strong>&raquo;</strong>
  4.  <a href="%%url%%" title="%%description%% [%%time%%, in %%tags%%]">%%title%%</a>
  5.  <span style="font-size: 0.8em; padding-left: 1em;">%%description%%</span>
  6. </li>';

Value : some html code.
Each link fetched will replace the %%LINKS%% template with this pattern, also using a set of templates :

  • %%url%% will be replaced by link url
  • %%description%% will be replaced by link description
  • %%time%% will be replaced by the time, according to $wp_ozh_deli_param['time_display'] as explained below
  • %%tags%% will be replaced by naked gurlz. Errrr, I mean, by the list of tags of the link. Just wanted to check if someone is reading.

$wp_ozh_deli_param['time_display'] = 'elapsed';
Value : 'time' or 'elapsed'

  • 'time' : prints at what time the link was posted on delicious, e.g. "2004-09-23 05:36" (see next parameter for Date pattern)
  • 'elapsed' : print the time elapsed since the link was posted on delicious, e.g. "5h40 ago"

$wp_ozh_deli_param['time_pattern'] = 'Y-m-d H:i';
Value : a string using the same syntax as the PHP date() function.
If previous parameter set to 'time', this will control the output format of the date. For example, a value of 'Y-m-d H:i' will print "2004-09-23 05:36" (a la del.icio.us)

$wp_ozh_deli_param['time_offset'] = 0;
Value : an integer, time offset between del.icio.us server and your server (not your computer)
Example : 3 means del.icio.us prints "15:12:23" when it's "12:12:23" on your server
Example : -2 means del.icio.us prints "15:12:23" when it's "17:12:23" on your server
Newbie tip: To check the time on your server, put the next line in a new file, upload on your server and read it with your browser :

  1. <?php print date("Y-m-d H:i:s"); ?>

$wp_ozh_deli_param['skip_empty'] = 0;
Value : 1 or 0.
If If your freshness & tag filter select no link, what to do ? Set to 1 not to print anything, set to 0 to print something anyway, as defined by the next parameter.

$wp_ozh_deli_param['no_entry'] = 'No entry today, sorry !';
Value: a string.
If the previous parameter is set to 0 (ie post something even if there is no link matching criteria on del.icio.us, this message will be printed in replacement of the links (%%LINKS%% tag in the output pattern)

WordPress Specific options

require_once './wp-blog-header.php';
This one is pretty usual. If you move taga.licio.us somewhere from your wordpress root dir, be sure to edit this accordingly.

$wp_ozh_deli_param['more'] = 5;
Value : an integer.
Number of posts after which to place a "Read more…" break when displayed in front page

$wp_ozh_deli_param['insert_sql'] = 0;
Value : 1 or 0.
Defines if you want the result to be injected as a post in your WordPress database. Default is 0 so you won't mess with it until you're done with editing :)

$wp_ozh_deli_param['userid'] = 1;
Value : an integer
This is the User ID to post in. Usually yours, the admin's. If unsure, check http://yourblog.com/wp-admin/users.php and look for yours.

$wp_ozh_deli_param['category'] = 1;
Value : an integer
Category id to put your tag.ali.cio.us links in. If unsure, check http://yourblog.com/wp-admin/categories.php

$wp_ozh_deli_param['allowcomments'] = 'open';
Value : 'open' or 'closed'
Allow comments on the posts ? Of course you want to. Otherwise, how would spammers get a life ? :-P

$wp_ozh_deli_param['allowpings'] = 'open';
Value : 'open' or 'closed'

$wp_ozh_deli_param['posttitle'] = 'Dai.ly tag.ali.cio.us';
Value : a string, title for your posts.

$wp_ozh_deli_param['postname'] = 'daily-tagalicious';
Value : a string, defind the "post slug" as used in permalinks (/archives/2004/10/04/daily-tagalicious/)

$wp_ozh_deli_param['excerpt'] = 'Daily load of links from del.icio.us on: ' . $wp_ozh_deli_param['tags'];
Value : a string, defining the post excerpt.

Important note for WordPress users

If you want to use the posting feature, for example at fixed hours with a cronjob, first rename the file to something secret and personnal. You don't want any lamer in the internet come to your site and reload wp-delicious-tagalicious.php till your MySQL base dies.

Integrating output into an existing page

This is done as usual with the include php function. For example, if you rename the script to "tagalicious.php", put this into your page :

  1. <?php include("tagalicious.php"); ?>

Known bugs

I am not too sure about how it handles utf-8. I've seen a lot of links with broken utf-8 on del.icio.us itself, so most of the weird content you'll fetch will be original content. I've been told it also depends on the version of your Mysql installation. Sorry, couldn't test this a lot. Anyway, it should be ok 99% of the time.

The feeds on del.icio.us are not always up to date. It seems they are updating them every 5 minutes or so, rather than generating them on the fly. Don't panic if your output misses one or two fresh links.

Wow

That was another long documentation, wasn't it ? Of course, I'm looking for celebrity feedback, so now go play with taga.licio.us !

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/2v

Metastuff

This entry "taga.licio.us : a way to integrate del.icio.us" was posted on 05/10/2004 at 12:09 am and is tagged with , , , , , ,
Watch this discussion : Comments RSS 2.0.

52 Blablas

  1. kyramas says:

    Any other ways except a cronjob (not allowed from my host) to call the script ?
    Thanks
    ps. By the way…great work !

  2. Ozh says:

    yes
    I'm posting a few hints in a new post, this seems to be a common question

  3. joshua says:

    It looks like this does not put any pause between hits. Please contact me to discuss this further.

  4. Ozh says:

    Errrr, my bad. Script updated, I hope this will improve things.

  5. Ryan says:

    I wrote a similar but far less complete del.isio.us plugin for wordpress people may be interested in.

    http://www.shadydentist.com/wordpress/archives/2004/10/15/wp-delicious-v01-rss-based-delicious-plugin-for-wordpress-121/

  6. hexodus says:

    Tagalicious
    I just finished setting up taga.licio.us here on my server: Hexodus Tagalicious It's pretty fresh, yet another way to integrate del.icio.us tags into your site. I am not entirely sure where I will go with this, if anywhere, but I…

  7. Blog says:

    Del.icio.us del.icio.us º܌ֈˏ ²»¶£¬˹Ҕ¿ª· taga.licio.us ….

  8. Del.icio.us いろいろ
    便利のhttp://del.icio.us/が最近、中国でGoogleとBlog…

  9. links for 2004-10-28
    .HTACCESS files useful tips and tricks (categories: Webdev) Apple – iPod Photo Apple unveils new iPod that can display photos (categories: Apple) A new way to submit your resume a senior recruiter from Microsoft: Blogging truly creates a win/win…

  10. 把你的美味书签显示在你%…
    看这里:) [lol]

  11. Tagalicios
    This looks to offer strong possibilities for making use of del.icio.us collections for creating usable reference lists.
    Taga.licio.us is a tag filter for del.icio.us : it produces a page with links from selected tags, allows to integrate del.icio.us l…

  12. links for 2004-11-14
    Is Google the new devil? | News.blog | CNET News.com Things that make you go "hmmm…" [via Linkpool] (categories:…

  13. brian's blog says:

    Why del.icio.us Sucks

    I sent an extremely condensed version (one sentence long) of this post to a friend recently, unprompted, for no reason…

  14. Del.icio.us Toolapalooza..;-)

    [via Absolutely Del.icio.us – Complete Tool Collection] Below we have a collection of useful tools for making your Del.icio.us experience better – Bunnyhug Updater del.icio.us – an application that lets you download all of your del.icio.us bookmarks an…

  15. […] Integration It is worthwhile to note that there are tools, such as tag.alicio.ustag.alicio.us and extisp.icio.us that aid in query […]

  16. […] gs, you may know some who already do this thing.. Update A similar thing can be done with taga.licio.us This entry […]

  17. […] this way you control the frequency yourself (tags: wordpress del.icio.us delicious) taga.licio.us : a way to integrate del.icio.us « plan […]

  18. derek says:

    The links to the "live examples" aren't working, just fyi.

  19. Ozh says:

    Hmm ? They are, or did you encounter something weird ?

  20. […] o.us, ia, wordpress It is worthwhile to note that there are tools, such as tag.alicio.us and extisp.icio.us that aid in query […]

  21. HongPong says:

    Ok, I found the problem. I guess this makes sense. I am experimenting with various ways to mess with RSS feeds, and I have the FeedWordPress plugin installed as well as your hack. When this plugin is active, I think it causes the rss_fetch function to get declared twice. Hence the error. By turning FeedWordPress plugin off, your hack seems to work fine. Huzzah!

  22. […] Update: Article about Integrating Delicious using MagpieRSS. […]

  23. lazopolis says:

    Any idea on how to handle non-latin characters (Greek in particular) ?

  24. Ozh says:

    If it's UTF-8, "should" be ok, even if I have had sometimes weird results I couldn't fix. In other words, "No, no idea" :)

  25. […] taga.licio.us : a way to integrate del.icio.us – вытаскивает из д.и.у выдачу по заданным тегам и интегрирует ее в страницу. […]

  26. damo says:

    Hi,
    Great script. I'm trying to mod it v slightly so I pass a variable (depending on where in my site you are) to the $wp_ozh_deli_param['tags'] variable.
    I'm having problems though, it doesnt seem to like what I'm doing.
    Instead of
    $wp_ozh_deli_param['tags'] = 'fashion';
    I've tried
    $wp_ozh_deli_param['tags'] = single_cat_title();
    To get it to show links tagged with my category title (wordpress).
    It doesnt like it though – single_cat_title() is populated.
    Any ideas?
    Thanks,
    Damo

  27. Folksonomies: Tags Strengths, Weaknesses And How To Make Them Work

    1. Introduction A folksonomy is a type of distributed classification system. It is usually created by a group of individuals, typically the resource users. Users add tags to online items, such as images, videos, bookmarks and text. These tags are…

  28. New Media Picks Of The Week: Sharewood Picnic 40

    Here is a new basket full of delicacies for our weekend Sharewood Picnic. New media resources and tools gathered during the past 10-15 days await your testing and validation before everyone else hears about them. Here are in fact what…

  29. […] Conclusion j'ai désactivé cette option pour le moment. Je pense que yadd peut être une bonne base pour un futur plugin sur ce thème. Autre piste à explorer : taga.licio.us […]

  30. […] taga.licio.us – tags […]

  31. Laura says:

    Thanks a bunch…this plugin looks great…can't wait to start using it. I was wondering where we should put it, if not in the WordPress plugins directory? Thanks.

  32. faustina says:

    lol I love your anti spam test, but what happens when someone can't do math? lol

    Anyway, this looks great but before I put it in and mess with the code, is there a way to randomize the links from tags? I want a list of 20 (out of 80 right now) links from 1 specific tag that will randomize on my site so that every refresh the list of 20 will produce random links from that tag. I though this option would be great so that I don't have to post mu huge list, and the links could show up randomly in a smaller list, not by date, so that every one gets rotated.

    Please let me know if you know how I could do this!

  33. important plugin
    i install, thanks

  34. […] del.icio.us篇 Del.icio.us这是一个很棒的基于web的社会书签工具。另外值得一提的是,它的这个域名也很有意思,把英文delicious(美味的)适当的分开来作为域名,的确很有创意。 随 着Del.icio.us使用的用户越来越多,形形色色的工具、插件和附加工具也越来越丰富。当然Del.icio.us本身也提供了相当多的工具,比如 能把Del.icio.us中的书签每日自动发布到wordpress日志中、使用del.icio.us跟踪你的blog等等,而这里就列出了一个全面 的第三方扩展工具列表,下面,我们就来看看这些东西能给我带来什么功能。 Del.icio.us新的搜索工具 - 提供多种方法搜索你自已或别人的tag和书签。 Trendalicious - 一个del.icio.us上网站流行趋势的实时查看工具 Delicious Linkbacks - 与前面我写的使用del.icio.us跟踪你的blog类似的一个工具,可以查看有哪些人收藏了当前你访问的网址,列出一个列表。 del.icio.us most popular treemap - 用树形图的方式列出最受欢迎的网址列表[体积越大受欢迎承度越高,越明亮平均寿命越长] MySQLicious –把del.icio.us书签镜像到MySQL数据库中的工具 del.icio.us loader — 把Firefox中的书签直接导入到del.icio.us中的工具 introsp.icio.us — 一个Ruby脚本,用来分析你在del.icio.su中的书签,并生成一个你感兴趣的收藏列表。 Delibar — 它可以把你所有的书签存储到系统栏里,以便你可以非常方便的通过点击tag和链接来访问相关网站。 WordPre.cio.us — 导入del.icio.us书签到你的wordpress blog Search plugin for Mozilla browsers — 一个Mozilla插件,可以搜索del.icio.us中的书签。 HuntAndGather - 一个firefox扩展,提供很一些非常有用的功能。 del.icio.us import script — 一个prel脚本,导入Netscape中的收藏夹到del.icio.us中。 delicious-java — 一个与del.icio.us相结合的Java API The Easiest Way to Publish del.icio.us Links on Your Site — 可以让你在你的网站上发布链接 delicious-discuss –一个多用途的邮件列表,可以与其它del.icio.us用户之间进行聊天。 Automatic filing with del.icio.us - 自动归档当前网页到del.icio.us Wetaste - 一个Del.icio.usçš„WYSIWYG发掘工具 sid.vicio.us - 为del.icio.us上的tag创建ontologies del.icio.us tag search - del.icio.us tag查找工具 foxylicious - 一个Mozilla Firefox 扩展,用来同步你的del.icio.us书签到你的浏览器收藏夹。 extispicious - 产生随机和并列的tag, taga.licio.us - 一个tags过滤工具 avar.icio.us — 另一个del.icio.us递交界面 Firefox plugin - Firefox插件,使用firefoxå’Œdel.icio.us结合为一体。 Durl- 一个del.icio.us URL查询工具,并提供RSS输出. del.icio.us + Gmail - 一个每天运行一次的脚本,可以索引每一个链接,然后发gmail给你。 del.icio.us Tag Stemmer - 帮你查找你的tags中是否有相同含义的单词,以便你清理tag. delicious2safari — 导入del.icio.us书签到Safari中。 cocoalicious –一个Mac OSXçš„del.icio.us客户端。 Sorting del.icio.us/popular - 一个书签栏, Pasta - 一个del.icio.us的纯文本粘贴服务。 Mapping del.icio.us with Anthracite and OmniGraffle - 一个del.icio.us tag创造视觉探究的教程。. delicious.py — 使用python,通过del.icio.usçš„API允许你访问它的服务 Extended del.icio.us bookmarklets - 用来扩展del.icio.us 的功能。 Delicious Link Checker –一个perl脚本,接收所有用户的链接并检查它们,输出一个是否仍可以访问或错误代码及一些有用信息。 foaflicious - 一个可以从你的del.icio.us收件箱中生成FOAF文件的应用程序。 del.icio.us Illogical Interface - 不同的tag界面 Backup Del.icio.us with Excel — 帮助你备份书签到Excel 2003 Delicious Mind Map Maker - 一个集群图生成工具. Oishii - 一个在del.icio.us上受欢迎网站的列表。 BookmarksToDelicious -一个独立的Python客户端帮你从一个文件中递交书签到del.icio.us is Bunnyhug Updater del.icio.us - 一个程序让你下载你自已所有的del.icio.us书签到你的本地机器上。 Del.icio.us popular sites — 显示最近指定时间内最受欢迎的站点。 del.icio.us Smart Tagging Plugin for WordPress - 一个为wordpress准备的del.icio.us 插件。 Related del.icio.us Links in Your Sidebar - 关联的del.icio.us链接在你的工具条中. Integrating Bloglines and del.icio.us –能非常方便的把你正在Blogines中阅读的链接发布到del.icio.us中。 Gnomolicious –一个GNOME Java程序,可以帮助你通过拖拉来发布链接到del.icio.us网站。 Services Delicious –. 一个del.icio.us基于web的服务,它可以让你从任何PHP脚本选择、添加和删除你的书签。 Graph del.icio.us subscriptions network — 图形化浏览del.icio.us用户网络 […]

  35. […] 插件页面:点击进入 […]

  36. […] taga.licio.us : a way to integrate del.icio.us « planetOzh (tags: del.icio.us wordpress plugin) […]

  37. […] taga.licio.us a way to integrate del.icio.us (tags: Del.icio.us tools wordpress) […]

  38. Anonymous says:

    The Tagging Toolbox : 30+ Tagging Tools…

    (* Source: Stan Schroeder *) See also: World’s First Review of Streamy – The AJAX-based Digg Rival – Tags – for some, one of the best ideas on the web, for others, merely a visual distraction. Yes, we’re talking about……

  39. […] Taga.licio.us Taga.licio.us is a tag filter for del.icio.us : it produces a page with links from selected tags, allows to integrate del.icio.us links for one or more tags into an existing page, limited to a specified "freshness" (links of the day ? of the hour ?), and comes with gazillions of options. […]

  40. […] Taga.licio.us: Organize your del.icio.us tags with this application, which creates pages of favorite links on your WordPress blog. […]

  41. […] Tagalicious […]

  42. bernabauer says:

    Is there by any chance a new version coming out to fix that categories thing that changed in WordPress 2.3?

  43. Ozh says:

    bernabauer » wow, this is a pretty old stuff :) I'll have a look (heck, I dont even remember precisely what this is about ;)

  44. bernabauer says:

    this is a very good script. I might say, it is the only one that fits to my needs! If it would be updated I should be a happy blogger until the next update! ;-)

  45. […] and forthwith, I present the Taglicious plugin for WordPress (not to be confused with the taga.licio.us plugin for WordPress), which you can download below.  Whenever a post or page is saved, the content is scanned for […]

  46. […] taga.licio.us (affiche la liste complète des liens delicious. Différentes options d'affichage). […]

  47. […] taga.licio.us : a way to integrate del.icio.us « planetOzh produces a page with links from selected tags, allows to integrate del.icio.us links for one or more tags into an existing page, limited to a specified "freshness". It is also able to directly post into your database. (tags: wordpress plugin) […]

  48. Hmmm, came here to look at your youtube plugin, and then I find this! I stated my first wordpress plugin a few days ago, and guess what I wanted to make? THE EXACT SAME THING! Doh!

    Oh well, I think I will still try to finish mine, I just needed to have a good reason to learn how to make plugins, and I still have a ton of things to do on it.

    Anyways, take a look at my stuff at http://pappmaskin.no/2008/10/playing-with-snapcasa-screenshots-and-delicious/. What is different with mine is that I uses the xslt-support in php5, and that I included thumbnails from SnapCasa, which I feel added a good dimension to the feature.

    My wordpress plugin is not online yet, I have to find out how to widgetize and shortcode it, and I also want to find out how I can make it generate a "page" plus nice permalinks etc.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?