In: , , , , , ,
On: 2004 / 10 / 05
Shorter URL for this post:

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, yet another php hack ! is a tag filter for : it produces a page with links from selected tags, allows to integrate 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 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 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 :

The script comes in two flavors : one for anyone willing to integrate 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/';
This is the physical path to your Magpie copy.
Note for windows users : put path like 'C:/myweb/magpierss/' (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 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 in your Magpie directory)

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 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 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 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


  1. $wp_ozh_deli_param['post'] = '
  2. : %%COUNT%% links from <a href=""></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


  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

$wp_ozh_deli_param['time_offset'] = 0;
Value : an integer, time offset between server and your server (not your computer)
Example : 3 means prints "15:12:23" when it's "12:12:23" on your server
Example : -2 means 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, 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 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 and look for yours.

$wp_ozh_deli_param['category'] = 1;
Value : an integer
Category id to put your links in. If unsure, check

$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'] = '';
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 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 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 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.


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

Shorter URL

Want to share or tweet this post? Please use this short URL:


This entry " : a way to integrate" 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 ?
    ps. By the way…great work !

  2. Ozh says:

    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 plugin for wordpress people may be interested in.

  6. hexodus says:

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

  7. Blog says: º܌ֈˏ ²»¶£¬˹Ҕ¿ª· ….

  8. いろいろ

  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 collections for creating usable reference lists. is a tag filter for : it produces a page with links from selected tags, allows to integrate l…

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

  13. brian's blog says:

    Why Sucks

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

  14. Toolapalooza..;-)

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

  15. […] Integration It is worthwhile to note that there are tools, such as and that aid in query […]

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

  17. […] this way you control the frequency yourself (tags: wordpress delicious) : a way to integrate « 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. […], ia, wordpress It is worthwhile to note that there are tools, such as and 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. […] : a way to integrate – вытаскивает из д.и.у выдачу по заданным тегам и интегрирует ее в страницу. […]

  26. damo says:

    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?

  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 : […]

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

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

  36. […] : a way to integrate « planetOzh (tags: wordpress plugin) […]

  37. […] a way to integrate (tags: 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. […] is a tag filter for : it produces a page with links from selected tags, allows to integrate 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. […] Organize your 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 plugin for WordPress), which you can download below.  Whenever a post or page is saved, the content is scanned for […]

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

  47. […] : a way to integrate « planetOzh produces a page with links from selected tags, allows to integrate 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 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 ?