Del.icio.us in b2evolution

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions
View previous topic :: View next topic  
Author Message
captsolo
Seasoned Poster
Seasoned Poster

Joined: 19 Aug 2003
Posts: 70
Reputation: 67.6Reputation: 67.6Reputation: 67.6Reputation: 67.6Reputation: 67.6Reputation: 67.6Reputation: 67.6 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Sun Sep 19, 2004 15:41    Post subject: del.icio.us in b2evolution Reply with quote

delicious 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.
Quote:
See for example my del.icio.us bookmarks.

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?

_________________
Best regards,
CaptSolo
Back to top
View user's profile Send private message Visit poster's website
mort
New Poster
New Poster

Joined: 16 Feb 2005
Posts: 1
Reputation: 14.8 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Wed Feb 16, 2005 2:50    Post subject: yes! Reply with quote

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?
Back to top
View user's profile Send private message
holger
New Poster
New Poster

Joined: 05 Mar 2005
Posts: 6
Reputation: 14.3 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Sat Mar 05, 2005 18:30    Post subject: Reply with quote

There is a del.icio.us-to-wordpress plugin:
http://heisel.org/blog/2005/03/03/del2wp/


Maybe that's inspiring for somebody?


I'd like to have a "b2evo.li.cio.us", too! You know, a del.icio.us-to-b2evolution-thing...



holger
Back to top
View user's profile Send private message Visit poster's website
Walter
Hooked :)
Hooked :)

Joined: 11 May 2004
Posts: 416
Reputation: 114.2 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 5

PostPosted: Mon Mar 07, 2005 11:07    Post subject: A simple test Reply with quote

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)
Code:

<?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/ma...icious.php

I think that is not hard put ths SQL?s Smile


Last edited by Walter on Tue Aug 09, 2005 9:27; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Mon May 16, 2005 13:52    Post subject: A more complete solution Reply with quote

I'm using the following right now.

1) Changed _main.php:
Code:
<?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:
Code:
<?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: YABFOG
--


Last edited by Dan on Fri Jun 24, 2005 14:53; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Wed May 18, 2005 10:19    Post subject: Follow-up Reply with quote

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

Also, the cache is working just fine.
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Wed May 25, 2005 21:39    Post subject: Re: Follow-up Reply with quote

Dan wrote:
I modified the code a bit to fix a couple of mistakes (missing quotes aroung the href Embarassed) 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
Back to top
View user's profile Send private message Visit poster's website
Walter
Hooked :)
Hooked :)

Joined: 11 May 2004
Posts: 416
Reputation: 114.2 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 5

PostPosted: Fri May 27, 2005 14:52    Post subject: Reply with quote

Realy good Smile

Thank you - my code was absolutely experimental

BTW, the delicious itself has a api. Look: http://del.icio.us/doc/api
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Fri May 27, 2005 16:23    Post subject: Reply with quote

Thank you! Very Happy Your experimental code gave the framework -- I hate starting from scratch. Wink

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 -- e107 does that).
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Fri Jul 15, 2005 15:35    Post subject: More Updates Reply with quote

I've made additional modifications to the del.icio.us sidebar item.

My post is here, and the latest version of the code is here.
Back to top
View user's profile Send private message Visit poster's website
Dan
New Poster
New Poster

Joined: 16 May 2005
Posts: 11
Reputation: 12 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Mon Aug 15, 2005 18:18    Post subject: New, improved solution - MySQLicious Reply with quote

Walter, thanks for turning me on to MySQLicious. It's a much better solution for including your del.icio.us bookmarks as a b2evolution sidebar item.

I'm using the new code I wrote on my site. Check it out.

The code -- My site -- My post describing the set-up
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board