ma.gnolia plugin

Creating and modifying plugins.
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

ma.gnolia plugin

Post by mattsches »

Hi, it's me again. I decided to give ma.gnolia a try. ma.gnolia is a bookmark sharing service not unlike del.icio.us or many others out there. While del.icio.us remains the most popular platform, ma.gnolia has a nicer site design and supports microformats better than others, I guess (I've been very much into microformats lately :wink: ).

While it's dead easy to customize the delicious sidebar plugin (it's just a matter of search for delicious and replace it with magnolia ... it really works), I doubt it is the right way to create an individual plugin for each and every service out there.

So, how about extending the existing delicious plugin? Should be quite easy to add other services from which you can pull your bookmarks via RSS. We'd need another option for service name and/or service URL.

OTOH, it could make adding new features to the plugin a bit more complex, if services or service APIs differ too much.

Opinions? Anyone interested in this at all?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

That's exactly the kind of thing Garvin is looking for: extending existing plugins, instead of creating a huge crop of little ones. Granted, it's not the Unix Way, but we're not creating an operating system here, are we?

It would be especially nice to get Serendipity mentioned somewhere. If you do extend the delicious plugin, we'll commit it; then could you mention to the magnolia admins that Serendipity supports their service? Maybe they'll add us to their list of supported blogs.

And of course, if you have any questions about how to make the mods, this is the place to ask. You seem more than capable in that respect, but if you do have any questions, we'll be happy to help.
Judebert
---
Website | Wishlist | PayPal
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Thanks for the feedback, Judebert. I agree that S9Y needs more publicity. I have just been looking on a couple of social bookmarking services, and they have lists of blog software on their "software that supports our product" page. S9Y was missing more often than not. I'd be glad to improve this situation.

So, what I'm doing right now is pimping the existing plugin and including a handful of other services. So far, the plugin works with the RSS feeds of del.icio.us, ma.gnolia.com, furl.net, and linkroll.com. Others can be added as required :wink: Why not post your suggestions here in this thread?

The author of the original del.icio.us plugin, riscky, seems to have plans to switch his plugin to the del.icio.us API as well as other improvements. I guess, I will stick to RSS, however, but that shouldn't be much of a problem.

What I am currently thinking about is displaying the tags that belong to a bookmark and link them to either the blog's tags or, if the freetag plugin isn't installed, to the bookmark service's tags. So much for now :roll:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

That would be awesome. Keep it coming, we need exactly your kind of spirit. :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Initial release

Post by mattsches »

Hi all,

I've finally decided to release a first version of my social bookmarks plugin. It's based on the existing del.icio.us plugin, but works with the ma.gnolia.com, furl.net, and linkroll.com services, too. It's even possbile to display the respective tags of each bookmark in your linkroll. This feature is only useful if you installed the freetag plugin, though.

So, if you're interested in this plugin, please download it, install it, and - most important - test drive it. Any feedback, suggestions, or feature requests will be welcome, just add them to this thread or send me a message.

You can see the plugin in action on my weblog. The download page is here (German only, English version soon).

Have fun, and keep the comments coming :wink:

Cheers
- Mattsches
kodewulf
Regular
Posts: 14
Joined: Mon Jun 12, 2006 7:57 am
Location: Melbourne, Australia

Post by kodewulf »

Hi,

I hope you don't mind. I had a look at your plugin. I tried to use it with all three services (magnolia, furl, delicious). Although it installed properly, all three instances should me the same data. I've included the fixes I've made to the generate_content() function.

Code: Select all

        $socialbookmarksID = $this->get_config('socialbookmarksID');
        
        if (empty($socialbookmarksID)) {
            return false;
        }

        $socialbookmarksService = $this->get_config('socialbookmarksService');
        $title = $socialbookmarksService;
        $moreLink = $this->get_config('moreLink');
        
        $md5_socialbookmarksID = md5($socialbookmarksID);
        $md5_socialbookmarksService = md5($socialbookmarksService);

        if ($this->get_config('displayNumber') < 31 && $this->get_config('displayNumber') >= 1) {
            $displayNumber = $this->get_config('displayNumber');
        } else {
            $displayNumber = 30;
        }

        if ($this->get_config('cacheTime') > 0) {
            $cacheTime = ($this->get_config('cacheTime') * 3600);
        } else {
            $cacheTime = 3600 + 1 ;
        }

        switch ($socialbookmarksService) {
            case 'del.icio.us':
                $gsocialbookmarksURL	= 'http://del.icio.us/rss/';
                break;
            case 'ma.gnolia':
                $gsocialbookmarksURL	= 'http://ma.gnolia.com/rss/full/people/';
                break;
            case 'furl':
                $gsocialbookmarksURL	= 'http://www.furl.net/members/';
                $gsocialbookmarksURLsuffix = '/rss.xml';
                break;
            case 'linkroll':
                $gsocialbookmarksURL	= 'http://www.linkroll.com/xml.php?action=links&user=';
                break;
            default:
                break;
        }

        $gsocialbookmarksCacheLoc = $serendipity['serendipityPath'].'/templates_c/socialbookmarks_';
        $parsedCache = $gsocialbookmarksCacheLoc.$md5_socialbookmarksService.'_'.$md5_socialbookmarksID.'.cache';
All the code below the $parsedCache variable stays the same.

I hope this helps. Thanks for a very good plugin.

Kodewulf
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Hi kodewulf,

thanks a lot for your patch :D I've been aware of the problems with the cache, but didn't pay enough attention to it. I was looking more into the direction of event_hooks, but since we're dealing with a sidebar plugin ... Anyway, I will apply your changes, and I'm happy there are people like you who actually look at the code and are even aware of tiny issues like the duplicate get_config() call!

- Mattsches
kodewulf
Regular
Posts: 14
Joined: Mon Jun 12, 2006 7:57 am
Location: Melbourne, Australia

Post by kodewulf »

No problem.

Let me know when you have a new version for download. I'll put it through it's paces for you. :) It's amazing how easily you can miss the small things. :)

It's a great plugin, keep it up.

Kodewulf
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Please tell me the final download URL for that plugin, so that I can submit it to spartacus?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Hi Garvin,

I'm currently fixing some more small issues, but I'll post the link here as soon as I'm finished.

I've got one more question, though: If I want to get rid of style attributes and want to use classes instead, how can I add CSS styles to the template's CSS? Is this only possible from within an event plugin?

Regards,
- Mattsches
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, you can only do that with an event plugin because of the plugin API concept (which stems from performance reasons). But you can create a event plugin within the same directory and load that via the $this->dependencies() array.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Ok, thanks, exactly as expected :wink: Therefor, I decided to postpone the CSS stuff until the "next release" of my plugin. You can download the most current version right here.

Some more info: Tags are only displayed if the freetag plugin is installed (Garvin, please check if I did that right). As a bonus, if tags are displayed, things should conform to the xFolk microformat. I will contact the people at ma.gnolia and the other services within the next days and ask them to put some info about S9Y on their sites.

Just added: Microformats xFolk Wiki

Regards,
- Mattsches
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Looking good! Thanks for your help with Serendipity!
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I just committed that plugin! I made two minor changes, changing version number to 0.34 (DOCUMENT_ROOT removed and different more performant way of plugin class detection)

Best regards
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Thanks for the fixes and for committing the plugin to CVS, Garvin.

Now I can go on working on my microformats plugin. :)
Post Reply