Recent Topics

1 Sep 19, 2004 22:41    

[url=http://del.icio.us]delicious[/url] is a next wornderful thing - a social bookmark manager.

To see how it works, you have to start using it yourself, posting bookmarks and discovering people who have posted same bookmarks and share same interests. This is similar in beauty to what Flickr.com offers for photos, Gmail's revolution for web e-mails and Orkut & LinkedIn for social networks.

You can see that del.icio.us allows people to assign tags (in other words - keywords) to each bookmark.

See for example [url=http://del.icio.us/captsolo]my del.icio.us bookmarks[/url].

Or - you can see bookmarks that *all people* have filed in a given tag - example: http://del.icio.us/tag/bookmarklets

It also provides RSS feeds of all these pages - be it people's bookmarks, bookmarks for tags or top-filed bookmarks.
See: http://del.icio.us/rss/captsolo

What I am thinking of - what if we process this RSS (of our bookmarks) and add these bookmarks as posts to our link-blogs?

I am not sure how to do the parsing RSS part, but once we have got the information (url, title, comments, keywords, what else is there), posting it to the blog should be easy.

Each keyword will have its 'twin' as b2evo category. If a category does not exist in link blog, it is created [under some default main category like 'Unfiled keywords']; if it exists, post is filed in this category.

Beauty of this (what b2evo can add and what is not there initially) is that later we can organize the categories in b2evo in the tree hierarchy and so have:
1) more logical keyword category structure compared with just a list of keywords in del.icio.us
2) link blog will also act as a backup for del.icio.us bookmarks.

Realisation: it would be handy to have the keyword name for a category in a separate field from category name - then the category names could be nicer looking that del.icio.us keywords.

What do you say about such a plot?

2 Feb 16, 2005 08:50

I was just looking to see if anyone had done this.

Combine automatically blogging your del.icio.us feed with pulling down snapshots from alexa/snapshots. That would be beautiful. Perhaps it could only blog certain keywords, or ignore certain others. This would be an amazingly fast way to blog things, but could be extended to read other rss feeds I imagine?

4 Mar 07, 2005 17:07

Well.. I made a simple teste here...

Parse a RSS with magicpie it?s easy .. And the delicious to wordpress uses magpie..

O put a simple example, almost all from the magpie source..

The script gets a RSS feed and show 4 random entries.

The source (uses magpie)


<?php

define('MAGPIE_DIR', '../');
require_once(MAGPIE_DIR.'rss_fetch.inc');

$url = $_GET['url'];

function shuffle_me($shuffle_me, $howmany) {
   $randomized_keys = array_rand($shuffle_me, count($shuffle_me));
   foreach($randomized_keys as $current_key) {
       $shuffled_me[$current_key] = $shuffle_me[$current_key];
   }
   $shuffled_me = array_slice($shuffled_me, 0, $howmany);
   return $shuffled_me;
}

// shuffle_me get from http://br2.php.net/manual/en/function.shuffle.php


if ( $url ) {
	$rss = fetch_rss( $url );
	$rss->items = shuffle_me($rss->items, 4);
	echo "Channel: " . $rss->channel['title'] . "<p>";
	echo "<ul>";
	foreach ($rss->items as $item) {
		$href = $item['link'];
		$title = $item['title'];
		echo "<li><a href=$href>$title</a></li>";
	}
	echo "</ul>";
}

?>
This script will get 4 random entries from a RSS.. <br />
Try, by example with this URL: <b>http://del.icio.us/rss/waltercruz</b>

<form>
	RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
	<input type="submit" value="Parse RSS">
</form>

A exemple running: http://waltercruz.com/devel/magpie/scripts/delicious.php

I think that is not hard put ths SQL?s :)

5 May 16, 2005 20:52

I'm using the following right now.

1) Changed _main.php:

<?php // -------------------------- LINKBLOG INCLUDED HERE -----------------------------
// - I'm using del.icio.us instead
//		require( dirname(__FILE__).'/_linkblog.php' );
		// -------------------------------- END OF LINKBLOG ---------------------------------- ?>


    <?php // -------------------------- del.icio.us BOOOKMARKS INCLUDED HERE ---------------
		require( dirname(__FILE__).'/_delicious.php' );
    // --------------------------------- END OF del.icio.us BOOOKMARKS ---------------------- ?>

2) Added Magpie to my PHP includes (actually, using .htaccess).

3) Created _delicious.php:

<?php
	/**
	 * This is the template that displays a selection of del.icio.us links
	 *
	 * This file is not meant to be called directly.
	 * It is meant to be called by an include in the _main.php template.
	 *
	 * b2evolution - {@link http://b2evolution.net/}
	 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
	 *
	 */
	if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );

define('MAGPIE_CACHE_ON', 1);
define('MAGPIE_CACHE_DIR', '{SPECIFY YOUR DIR HERE}');
//define('MAGPIE_DEBUG', 2);
require_once('rss_fetch.inc');

$url = 'http://del.icio.us/rss/yabfog';
$urllink = 'http://del.icio.us/yabfog';
$numitems = '15';

function shuffle_me($shuffle_me, $howmany) {
    $randomized_keys = array_rand($shuffle_me, count($shuffle_me));
    foreach($randomized_keys as $current_key) {
        $shuffled_me[$current_key] = $shuffle_me[$current_key];
    }
    $shuffled_me = array_slice($shuffled_me, 0, $howmany);
    return $shuffled_me;
}
// shuffle_me get from http://br2.php.net/manual/en/function.shuffle.php

function getDelicious($url, $urllink, $numitems) {
    if ( $url ) {
        $rss = fetch_rss( $url );
        if (!(count($rss->items) > 0)) {
        echo '<div class="bSideItem">Error: Could not fetch del.icio.us rss feed.</h3></div>';
        }
    else { 
        $rss->items = shuffle_me($rss->items, $numitems);
        echo '<div class="bSideItem"><h3>Random Selection of Bookmarks from <a href="'.$urllink.'">' . htmlentities($rss->channel['title'], ENT_COMPAT) . "</a></h3>\n";
        echo "<ul>\n";
        echo '<li>An <img alt="RSS 1.0/RDF" src="../../img/rss_small.png" class="middle" /> feed of these links is available at <a href="'.$url.'">'.$url."</a>.</li>\n";
        foreach ($rss->items as $item) {
            $href = htmlentities($item['link']);
            $title = htmlentities($item['title'], ENT_COMPAT);
            $keywords = explode(" ", (htmlentities($item['dc']['subject'], ENT_COMPAT)));
            $listitem = "<li><a href=\"$href\">$title</a><span style=\"font-size:7pt;\"> (";
            foreach ($keywords as $keyword) {
                $listitem .= '<a href="http://del.icio.us/tag/'.$keyword.'" target="_blank">'.$keyword.'</a> ';
                }
            $listitem = rtrim($listitem) . ")</span></li>\n";
            echo "$listitem";
            }
        echo "</ul>\n</div>";
        } 
    }
}

getDelicious($url, $urllink, $numitems);

    if (MAGPIE_DEBUG) {
    ?>
<pre>
<?PHP var_dump($rss); ?>
</pre>
    <?
    }
    ?>


4) Finished product: [url=http://www.yabfog.com/blog/]YABFOG[/url]
--

6 May 18, 2005 17:19

I modified the code a bit to fix a couple of mistakes (missing quotes aroung the href :oops:) and htmlentity encode the feed title, link title and list of keywords.

Also, the cache is working just fine.

7 May 26, 2005 04:39

Dan wrote:

I modified the code a bit to fix a couple of mistakes (missing quotes aroung the href :oops:) and htmlentity encode the feed title, link title and list of keywords.

Also, the cache is working just fine.

I've edited my post above with the full code I'm using now.

Features (recap and update):

  1. Uses Magpie to fetch and cache the del.icio.us feed

  2. Proper error checking of the fetch

  3. Adds a link to the raw feed (but beware the IMG that you are likely missing!)

  4. [*]For each bookmark, provides a link to the del.icio.us tag page for each associated keyword[/list:o]

9 May 27, 2005 23:23

Thank you! :D Your experimental code gave the framework -- I hate starting from scratch. ;)

The API is interesting. With Magpie's caching, though, I'm not sure that the API offers anything useful that we can't easily do with the RSS feed. For example the update checking available in the API is not necessary when you use Magpie. And although the API permits adding and deleting of posts, that's not really going to be much use as part of a sideitem, is it?

I guess the one thing I'd use the API for would be to display my del.icio.us inbox -- but that function is not even enabled right now.

On the other hand, rewriting the code to utilize the API instead of requiring Magpie would make it more portable and maybe even permit François? to include it in the distribution (although Magpie is open source, so he could bundle it in whole or in part, I suppose -- [url=http://e107.org]e107[/url] does that).


Form is loading...