Pressure is nothing more than the shadow of great opportunity. - Michael Johnson

Delicious Stumble

3 years, 7 months ago

I recently spent quite a bit of time re-organising and tagging my del.icio.us bookmarks and quickly realised that I'd forgotten about a lot of really useful links I'd bookmarked. I really like StumbleUpon - clicking the Stumble button takes you to a random site and is a really great way to discover new sites so I thought it might be fun to put together a script which does the same for my del.icio.us bookmarks. Here its is:

  1. <?php
  2. require('php-delicious.inc.php');
  3. define('CACHE_PATH', '/tmp/');
  4. define('CACHE_TIME', 3600);
  5. if (!isset($_GET['user']) || !isset($_GET['pass'])) {
  6. die('Missing del.icio.us username or password.');
  7. }
  8. isset($_GET['tag']) ? $sTag = $_GET['tag'] : $sTag = '';
  9. $oDelicious = new PhpDelicious($_GET['user'], $_GET['pass'], CACHE_TIME);
  10. if ($aPosts = $oDelicious->GetAllPosts($sTag)) {
  11. $iPost = array_rand($aPosts);
  12. header('Location: '.$aPosts[$iPost]['url']);
  13. exit;
  14. } else {
  15. echo 'Could not fetch bookmark.';
  16. }
  17. ?>

View plain text version

It uses my PhpDelicious class which you can download here. Copy the script and PhpDelicious to your web server. The script takes 2 compulsory parameters - user and pass which correspond to your del.icio.us account details.

http://yourserver/delicious-stumble.php?user=YOUR_USER&pass=YOUR_PASS

You can optionally specify a tag parameter which restricts the script to returning items tagged with that value.

http://yourserver/delicious-stumble.php?user=YOUR_USER&pass=YOUR_PASS&tag=css

Add a bookmark to your browser's bookmark bar which references this script for the full StumbleUpon experience.

Comments

  • More cool stuff, Ed, thanks. I just got through integrating your server-side delicious badging on the YUI site (developer.yahoo.com/yui) to go along with SimpleRSS. I love the great tools you're coming up with. Regards, -Eric

    Eric Miraglia - 13th January 2007 #

  • Eric - Thanks once again for the feedback. It's good to hear when stuff I post is useful.

    Ed Eliot - 13th January 2007 #

  • I wrote a script a while ago which might be of interest to you as well.

    Its a quick greasemonkey script which uses http://similicio.us/ to find other sites which might be of interest based upon my current bookmarks.

    When you view any bookmark list in del.icio.us it adds an extra link after edit/delete called 'find similar' which links to the similicio.us service.

    The original greasemonkey script, an example screenshot and the script as a stand-alone firefox extension can be found at http://www.foobr.co.uk/greasemonkey/getSimilicious/

    Word of caution, this script was never designed for public use and is only tested on my home/work machines.

    Aaron Bassett - 13th January 2007 #

  • Aaron - Interesting stuff, thanks for posting. I hadn't come across similicio.us before but it looks really useful.

    Ed Eliot - 14th January 2007 #

  • Hey.. I have a question ... I 2 like Stumbleupon very much. Now I want to import my stumble pages into del.icio.us . Can you help me out...

    Harsha

    Harsha - 4th April 2007 #

  • hi i use a an add-on called gestured for Firefox and i`m trying to make a gesture that allows me to stumble but i have no idea how javascript works how do i get the javascript for something?

    erik - 18th September 2007 #

  • chat | Porno izle | sex izle | sicak sohbet Dear Admin, I thank you for this informative article. And I thank you for this I follow your vendors. It’s verry good. I wish you continued success whould you like. sicak chat | sohbet | chat | sohbet siteleri | chat siteleri | sohbetim | sohbet siteleri | This is a great resource for growing your buisness.There are various aspects in buiness management and to grow the business.This is a very useful for tool for young entepreneurs. Thanks You Admin chat siteleri | sohbet odalari | chat odalari - sohbet - sohbet kanalları - chat kanalları - mynet sohbet | Chat Sitesi

    kimene - 4th August 2010 #

  • thnxxx

    sohbet siteleri - 19th August 2010 #

  • perfect blog thanks

    izmir chat - 20th August 2010 #

  • thanks good blog

    hi5 - 31st August 2010 #

Help make this post better

Notes: Standard BBCode for links, bold, italic and code are supported. rel="nofollow" is added to all links. Your email address will never be displayed on the site.

Back to index