Yet Another DailyDelicious hack for WordPress

I wanted a nice simple way to mirror my daily bookmarks that I’ve added to [del.icio.us](http://del.icio.us) into [WordPress](http://www.wordpress.org)

Stephen Eyre’s [dailydelicious](http://www.dot-totally.co.uk/dailydelicious.txt) was close, but
not exactly they way I wanted it. He used the RSS feed, but that doesn’t give a good daily cutoff.

So, I present Yet Another Daily Delicious php script: [yadd.php](http://www.nozell.com/marc/blog/data/yadd-1.0.TXT).

It asks for just today’s bookmarks using the published api, parses the XML, generates nicely formatted HTML and creates a WordPress entry.

Here is the writeup from the code:
- – -

This is yadd.php V1.0 by Marc Nozell (marc@nozell.com) based on
Stephen Eyre's dailydelicious
(http://www.dot-totally.co.uk/dailydelicious.txt)

See http://www.nozell.com/blog/ for the latest version of
'yet another daily delicious' (yadd.php)

USAGE:

1) Edit the section below. At the very least use your del.icio.us
username and password ($del_user/$del_password)

2) Put there file somewhere on the server where you run WordPress.

3) Arrange for this page to be hit once a day, say 11:30ish your
local time. del.icio.us seems to track UTC so depending on which
timezone you live in, some bookmarks from your yesterday may show
up. Consider using a simple cronjob that looks like this:

30 23 * * * $HOME/bin/yadd.sh

where yadd.sh looks like this:

#!/bin/bash
curl http://www.yoursite.com/yadd.php

4) In the morning edit the entry if you wish. I've tried to generate
pretty HTML so it will be simple to edit the entry.

THINGS TO KEEP IN MIND

Anyone that hits the URL for this script will cause your current
bookmarks to be dumped into WordPress. Clearly this is not
desirable.

You have some options. The easiest is to keep this URL 'secret'.
Name it something unusual and put it in a non-obvious place.
Remember that if you display your web hit stats, the url will be
exposed. A better solution to use .htaccess to limit access. If
you do that remember to update the url wget uses to include the
username/password, something like this:
curl http://someuser:somepassword@www.yoursite.com/yadd.php

Enjoy,

-marc

Tags: , , , ,

71 Responses to “Yet Another DailyDelicious hack for WordPress”

  1. [...] he other solutions don’t rely on. Luckily, I stumbled across Marc Nozell’s DailyDelicious Hack that relies on [...]

  2. [...] (plugin, posts all links once per day…could you set the script to run more often?) YADD (does the same thing, goes thru api inste [...]

  3. [...] der: General blog useful — Marc Nozell @ 7:05 pm

    I’ve updated my Yet Another Daily del.icio.us (yadd.php) so it can be c [...]

  4. Prashant says:

    Could this be modified to make the posts on a weekly basis rather than daily?

  5. samsonite says:

    that is a great script. got it up and running fine. i want my daily bookmarks to display underneath any posts i make for a specific day, so if i set my cron to hit at, say, 12.01 am, can i make the yadd.php file fetch my links from the previous day? any help appreciated.

  6. Phrsnant , I think it can be modified that way … but… I would also like to know HOW

  7. Stratified says:

    Yet Another DailyDelicious Patch
    I recently setup up Yet Another DailyDelicious hack (yadd) on stratified. Among all of the daily del.icio.us grabbers, it seemed the easiest to configure and use, and indeed it is. The only problem is that for those of us (all eyes on Zach) who don’…

  8. Stratified says:

    Yet Another DailyDelicious Patch
    I recently setup Yet Another DailyDelicious hack (yadd) on stratified. Among all of the daily del.icio.us grabbers, it seemed the easiest to configure and use, and indeed it is. The only problem is that for those of us (all eyes on Zach) who don’t b…

  9. Zach says:

    Extremely useful little script.

    I wrote a patch that prevents yadd.php from posting if there are no links for that day. It is available here.

  10. Nice plugin, if you get a chance to develop it, I would really like to see the following:

    Make no post at all in the case that there are no daily links – at the moment the plugin makes an empty entry that must be deleted.

    If there are a large number of posts (e.g, over a fixed threshold), could the plugin use the more tag, so that we dont get an excessivly long posting on the home page.

  11. Stodge says:

    Enhanced Daily Del.icio.us plugin
    Working with PHP can be a bowel-churning experience; It is one of the most rubbish computer languages ever devised, because it encourages virtually every bad habit a developer could adopt. Its only saving grace is almost ubiquitous integration with Apa…

  12. Wyome says:

    Daily Delicious and POP3Gateway

    I have created a module to grab the last week’s del.icio.us and automatically post them as a blog entry. The idea, and much of the code came from Marc Nozell’s WordPress plugin. I cleaned up the code for Xaraya to handle it just a bit better, and…

  13. [...] s heb je enorme bezwaren stel me dan op de hoogte Het update script is voor de liefhebber hier te vinden.

    Comments
    »

    [...]

  14. [...] Plugins Database (nice xhtml/javascript interface) (tags: wordpress plugins plugin) Marc Nozell’s mini-blog » Blog Archive » Yet Another Da [...]

  15. [...] «å‰Šé™¤ï¼‰

    Yet Another DailyDelicious hack for WordPress

    Yet Another DailyDelicious hack for WordPress これを [...]

  16. [...] that this made for an ideal “remaindered links” wordflow. This script, called Yet Another Daily Delicious (YADD), is quite robust in [...]

  17. [...] looking for (or, dare I to mention, write) the appropriate script. The one was available here. With small modifications I guess it will do the [...]

  18. [...] uicklinks for 2005-07-01
    Posted on Friday, July 1st, 2005 at 1:18 pm in Quicklinks

    Yet Another DailyDelicious Uses a cronjob to get the d [...]

  19. [...] daily bookmarks that I’ve added to del.icio.us into WordPress" // posted by t.a.l. @ 11:53 PM    Comments: Post a Comment <<Home [...]

  20. knight says:

    it seem like the script is broken due to delicious api issue ?

  21. lazopolis says:

    I get the following errors:

    Warning: fopen(): URL file-access is disabled in the server configuration in /home/.jargon/lazopolis/yet.anotherblog.net/yadd.php on line 106

    Warning: fopen(http://…@del.icio.us/api/posts/get?dt=2005-08-29): failed to open stream: no suitable wrapper could be found in /home/.jargon/lazopolis/yet.anotherblog.net/yadd.php on line 106

    Warning: fread(): supplied argument is not a valid stream resource in /home/.jargon/lazopolis/yet.anotherblog.net/yadd.php on line 113

    Any idea on what’s wrong?

  22. Marc Nozell says:

    lazopolis,

    It looks like from the writeup in the manual page for fopen (http://us2.php.net/fopen) that is could be a configuration issue.

    -marc

  23. [...] Along the way, I stumbled over a link to Yet Another DailyDelicious hack for WordPress at Marc Nozell’s blog. It’s been a long time since I talked with Marc, back when he was active at RootsWeb. It was extremely nice to run across him again. [...]

  24. [...] Aquest script s’encarrega de copiar al wordpress totes les entrades que s’hagi fet durant el dia a del.icio.us! L’he modificat de manera que ho faci com a mi m’interessa (en català, eliminant informació no necessària i adaptant-lo al servidor) i ja està rulant! [...]

  25. Elana says:

    I just modified the script to use the CURL libraries instead of fopen and fread. It seems to work fine. My host (Dreamhost) doesn’t allow the fopen() libraries any longer. This is what I came up with after a couple of hours hacking at it.

    I’ll probably take another look at it tonight and see if I can make it skip days it detects no entries. I believe this can be done by pulling a die() if the XML string does not contain a </posts> in it.

    For example, I created my del.icio.us account today. If I look at yesterday’s date for the string, I get the following returned:

    <posts dt=”20051017″ tag=”" user=”chiieddy”/>

    Nothing else.

    BTW, for those who are asking about changing the date, for yesterday just change this line:

    $date = mktime(0,0,0,$today['mon'], $today['mday'], $today['year']);

    New line should read:

    $date = mktime(0,0,0,$today['mon'], $today['mday']-1, $today['year']);

    For those wanting a whole week, you’d have to create a recursive function to do so, the del.icio.us API only recognizes a single date at time. You’d have to set your cronjob to run weekly and then cycle through all the days of the week.

  26. del.icio.us

    I’ve signed up for a del.icio.us account which allows me to mark links as I find them. This will allow me to quickly mark pages I want to come back to and share them as well. Once a day, this blog will update with the day’s links. I&#…

  27. Elana says:

    Marc -

    Does the line:

    $del_showlink = true;

    (whether or not to show the link to your del.icio.us account) actually work? I can’t find any subsequent code in the php file using this variable.

  28. del.icio.us Script Update

    Good morning. The del.icio.us script I’ve been working on has been updated again. It now does the following…

  29. [...] Here is my small contribution to the wonderful world of WordPress : WP-cron YADD is an integration of YADD into WP-cron architecture. By this mean, no more hassle writing shell scripts and using system cron table. Instead … well, instead, nothing to do ! To install, put it in your plugins directory, provided YADD and WP-cron are installed, it will simply work. [...]

  30. [...] (YADD) hack for WordPress and a Cron job every night. Don’t get me started… Listen to this article| [...]

  31. Mikkel says:

    I get the following error message:

    Fatal error: Call to undefined function: current_time() in /var/www/mikkelwinther.dk/public_html/dagenslinks/yadd.php on line 91

    Any idea what’s wrong?

  32. Mikkel says:

    I’m using Elana’s modified version, by the way. But I get the same error message using the original version, only with a different line number for obvious reasons.

  33. Mikkel says:

    Never mind, I got it working. It seems I had a typo in the location of my WordPress location.

    Thanks for a great hack!

  34. [...] FeedBurner already gives some of these services. You can easily “mix” your blog news, with your Flickr photostream and your del.icio.us bookmarks. You can even mix them in different ways, say gather all your weekly del.icio.us bookmarks in one single post in the new feed generated. Or you could create your own “video channel” of videos indexed by Yahoo! and tagged with a certain keyword, like “funny”, or “football”. Or automatically post your del.icio.us bookmarks as a single post in your blog on a daily basis using yadd. Or combine a GeoRSS blog feed with geo-tagged Flickr images. Or upcoming.org events with rsswether.com… [...]

  35. [...] FeedBurner already gives some of these services. You can easily “mix” your blog news, with your Flickr photo stream and your del.icio.us bookmarks. You can even mix them in different ways, say gather all your weekly del.icio.us bookmarks in one single post in the new feed generated. Or you could create your own “video channel” of videos indexed by Yahoo! and tagged with a certain keyword, like “funny”, or “football”. Or automatically post your del.icio.us bookmarks as a single post in your blog on a daily basis using yadd. Or combine a GeoRSS blog feed with geo-tagged Flickr images. Or upcoming.org events with rsswether.com… [...]

  36. [...] Nozell, rhymes with Oh Hell » Blog Archive » Yet Another DailyDelicious hack for WordPress (tags: del.icio.us wordpress tools) [...]

  37. [...] Nozell, rhymes with Oh Hell » Blog Archive » Yet Another DailyDelicious hack for WordPress (tags: webtips) [...]

  38. [...] Nozell, rhymes with Oh Hell » Blog Archive » Yet Another DailyDelicious hack for WordPress (tags: wordpress del.icio.us delicious plugin php plugins blog) [...]

  39. [...] Yet Another DailyDelicious hack for WordPress This is another way to get daily del.icio.us links into WordPress. It asks for just today’s bookmarks using the published api, parses the XML, generates nicely formatted HTML and creates a WordPress entry. (tags: wordpress del.icio.us plugins hacks) [...]

  40. [...] Here’s how I do it Sorry to disappoint you Steve, it’s 50% automatic and 50% human labor. If you’re wondering why my link posts look different, it’s because I’m using a more complex way of doing this instead of the Daily Del.icio.us posts technique I mentioned last month. My method isn’t for the faint-hearted as it involves the Yet Another Daily Delicious (YADD) hack (secured) for WordPress and a unix cron job every night. I didn’t explain beyond this previously, but this is the link posting workflow: [...]

  41. jcwinnie says:

    Thanks.
    WFM (Works For Me) WordPress on a remote server

  42. [...] Yet Another DailyDelicious hack for WordPress a nice simple way to mirror my daily bookmarks that I’ve added to del.icio.us into WordPress (tags: wordpress 2Do plugin del.icio.us) [...]

  43. [...] Yet Another DailyDelicious hack for WordPress a nice simple way to mirror my daily bookmarks that I’ve added to del.icio.us into WordPress (tags: 2Do, del.icio.us, plugin, wordpress) [...]

  44. [...] Nozell, rhymes with Oh Hell » Blog Archive » Yet Another DailyDelicious hack for WordPress I’m toying around with pulling in a “daily del.icio.us” feature into my blogging. We’ll see where that goes. (tags: del.icio.us) [...]

  45. [...] As with previous WordPress upgrades this one was also painless.  My ‘Yet Another Daily Delicious‘ and ‘Yet Another Weekly Delicious‘ continue to work also. I’ve not yet restored the style sheet header (this one) or added back some of the other doodads. [...]

  46. [...] Yet Another DailyDelicious hack for WordPress (tags: blog wordpress tools) [...]

  47. [...] Na een zoektocht met Google vond ik een php-script van Nozell, Yet Another DailyDelicious (yadd), waarmee je dagelijks een overzicht van je del.icio.us bladwijzers kunt laten publiceren. Het script wordt door de server op een vast tijdstip uitgevoerd, dus je hebt er verder geen omkijken meer naar en toch dagelijks automagisch een bericht op je blog. [...]

  48. [...] Nozell, rhymes with Oh Hell » Blog Archive » Yet Another DailyDelicious hack for WordPress – Tagged as: del.icio.us delicious [...]

  49. Klintron says:

    I’m having trouble setting up a chronjob to do this… I’ve googled for instructions on chronjobs, but I’m having trouble finding anything relevant. Am I understanding this right:

    Put the script in the same directory as WP on my server
    Also create a file called yadd.sh and put it there as well
    Set a chron job to yadd.sh

    I tried this and it didn’t seem to do anything.

    Any help would be appreciated.

    If it helps, my host is 1and1.com

  50. Chronjob help?…

    Another plea for help from my readership:
    I’m trying to use this WordPress hack to import my del.icio.us bookmarks in WP: YADD.
    I’m having trouble figuring out how to setup the chronjob right. If anyone could help me out, or at least point…

Leave a Reply