Introducing BlogLiner

In the past, I’ve used a bookmark synchronizing Firefox extension to upload an XBEL (XML) file to my web site each time I opened or closed Firefox. Everything worked great, but the number of bookmarks I had was getting very large very quickly, and uploading/downloading the XBEL file took longer and longer. It also took longer to load Firefox due to the amount of bookmarks it had to load on startup. Finally, I got fed up with it. I started searching for some sort of way to efficiently manage all these bookmarks and get the content I wanted to read on a daily (or even hourly) basis. Guess what I found…

Introducing Bloglines

A colleage of mine, Matt, posted an entry with a link that explained how to use Bloglines to keep track of my bookmarks. Skeptical but interested, I visited. Much to my surprise, Bloglines didn’t just look good, but it worked extremely well! I had expected it to be another run-of-the-mill, nothing-extraordinary service that I would end up forgetting about later on, but that proved not to be the case.

The tutorial helped me get a jumpstart on just why the site exists, to begin with. It’s not del.icio.us part 2, like I had previously thought. It is more of an RSS aggregator with a massive heap of features at your disposal. I highly recommend you sign up and at least give it a shot. If you think your Firefox Livemarks are sufficient, think again. When you get about 90 or more RSS feeds, you’ll know exactly what I’m talking about.

The API

One of the “big things” going around right now is APIs. Amazon has one, Google has one, eBay has one, and Bloglines has one. (Other sites have them, too, but those are the popular ones that come to mind.) The powerful thing about APIs is that they give developers access to cross-site information, which is very important for any site like Amazon, Google, eBay, or Bloglines. Equipped with an API, we can take information that we work with and store elsewhere and process/utilize that information on our own site. You have to agree, this is extremely convenient.

With Bloglines, you can take any username (and optionally any folder), and output them in an HTML format. Have a look at mine (or just my blogs folder). Awesome! Now we can just run a PHP include to get that HTML output on our site, right?

The Problem

Unfortunately, there is a slight inconvenience with the output result that we get from Bloglines. The output is a bunch of DIV’s! We know that this should obviously be an unordered list and not a bunch of DIV tags. This means that a simple “include my blogroll” won’t be sufficient if you want your web site to stay semantically correct. Additionally, you may wish to only output a specific number of blogmarks at any given time. The API doesn’t permit this (although you can separate a specific number of blogmarks in another folder at the Bloglines web site, it is not as convenient to create so many folders).

The Solution

Introducing BlogLiner (yes, you read that right: BlogLiner). What does BlogLiner do? It’s a Wordpress plugin that makes the Bloglines output into a pretty unordered list. Results are output exactly as you order/manage them on the Bloglines web site, so you manage your blogmarks as you would normally, and they’ll be output the same way on your blog. Oh, and yes, you can output just one folder or every folder you have on Bloglines. The only requirement is you have to have Wordpress to use the plugin. (If you’re a tricky fellow, you might take the source code and modify it to work in your own blogging software, though.)

Installation

First, download BlogLiner, unzip it, and upload the PHP file to your /wp-content/plugins/ directory. Then login to your Wordpress admin area and activate the plugin. Click the “Plugin editor” tab, select to edit the “BlogLiner” plugin, and change the settings appropriately. The four settings are your username, the folder you want to show as your blogroll (if you want to show all folders, leave the second variable empty), whether or not you want to show your support for Bloglines by including a link back to them at the end of the blogroll, and how many new blogroll entries you want to display. After you’ve done that, go to your theme editor and decide where you want to output your blogroll. Just pop this code there, and hit the update button:

<?php bloglines_roller(); ?>

You’re Done!

That’s it! There’s nothing more to it, thank goodness! Enjoy it, report bugs, suggest features, and let me know what you think about it!

Update!

I’ve updated the ZIP file. BlogLines now supports a URI-type command so that you can not only specify default settings, but override those settings by sending variable/value pairs to the function via var=value&var2=value2. There are examples in the new BlogLines.php plugin file of how to use it. Enjoy!

Update Again

I know it’s kind of obvious, but I just wanted to note that this extension is available for Textpattern, thanks to Bob.

Another update

I updated the plugin to version 0.2. There’s only one new feature, and that is folder titles appear when all folders are displayed.

Newsvine | Del.icio.us | Digg
In Wordpress, Plugins on May 5th, 2005 | 44 Remarks

44 Remarks to “Introducing BlogLiner”

  1. Bob remarks:

    An extension already? Bravo. I’d try it, but I don’t use Wordpress. =P

  2. Jona remarks:

    And the moral of the story is, use Wordpress. ;)

    (Alternatively, you might download my code and integrate it into your own blogging system as mentioned in my post, though that does require some decent PHP knowledge. I think you can do that, Bob.)

  3. Bob remarks:

    Hmm, it’s late. Didn’t dig into your code, but modified it for Textpattern.

    wdhaven.com/blogliner.php.txt

    Now it’s a textpattern plugin as well.

  4. Martin Neczypor remarks:

    Good work Jona, and thanks Bob, now I can use it too– If everything goes to plan expect it on my site soon.

  5. Jona remarks:

    I made some modifications to it and will updated my entry sometime today with a new version of the plugin. Also, thanks for the TxP port, Bob. Told ya you could do it. ;)

  6. Bob remarks:

    Jona, you suck, you made me actually do something. Gosh!

    I think the textpattern version is cooler, you can change the username, folder, limit, and show support options on a per-tag basis. And in version 0.1! Oh yeah!

  7. Jona remarks:

    Actually, it’s version 0.2 now.

  8. Bob remarks:

    Uh, that’s my point. I added that in the Textpattern port in version 0.1, you waited until 0.2. That makes me cooler than you. =P

  9. Jona remarks:

    Oh. Darn it! Darn YOU!! You and your coolness!!

  10. Martin Neczypor remarks:

    Lol yeah I saw that. I thought to myself, “man that bob guy is really on top of things” ;o). Again, great job Jona.

  11. Edmund Fladung remarks:

    awesome plugin. importing the BL xml ans then managing the links was not so hot. Your plugin works great! the div to li code is wonderful.

    thanks!

  12. Dave remarks:

    Hmm i can’t appear to get this to work, even using the default setting still get an error :S

  13. Jona remarks:

    Hi Dave, what error are you getting?

  14. Edmund Fladung remarks:

    hey jona, I’m getting an error also, you can see it here: Quality Peoples.com in my sidebar. You can see the output and then cut and paste that link into the location bar and it works fine.

    For some reason, it worked and then stopped working. I don’t know what i did to break it. I thought that maybe it was a BlogLines thing. any ideas?

  15. Jona remarks:

    Ed, if you didn’t change the plugin’s code, I can’t imagine why you’d be getting this error. Maybe you can email me the code?

  16. Edmund Fladung remarks:

    hi jona, let me make sure i didn’t mess with the code. i’ll uninstall the plugin and reinstall it again.

  17. Grant Palin remarks:

    A very useful plugin - saves me having to import my feeds from BlogLines. But I have a couple of quibbles, if you don’t mind!

    View the plugin in action on my site…Notice the gaps in the list? On BL, I have several folders of grouped feeds, but they don’t seem to come through using the plugin. Would there be any way to fix that?

    Also, you may want to escape HTML entities, since some feed titles have HTML characters in them, such as

  18. Grant Palin remarks:

    I mean & and <

  19. Jona remarks:

    Grant, those gaps are LI’s that contain UL’s. This is the proper HTML for grouping multiple nested unordered lists. The UL itself becomes a list item within the list. The LI’s that contain the UL’s have a class of “bloglinesfolder,” so you can style your CSS to change those gaps. As far as HTML-proofing, I suppose I can do that, though it appears that Bloglines does it for me already — so there isn’t really any need, as far as I can see.

  20. Grant Palin remarks:

    My remark about HTML-proofing comes from a particular entry in the list…Notice near the bottom of my links page, just after A List Apart and 456 Berea Street, an entry labeled “all in the”…The name is actually “all in the <head>”, with the actual angle brackets in place. So the end of the listing is missing, and there is an error, since the browser thinks there is an actual HEAD element in the middle of that link.

  21. Jona remarks:

    What’s strange, Grant, is that my Bloglines blogroll doesn’t do the same thing. In Bloglines, I have all in the , and if you look at my complete blogroll you can see that shows up fine. I thought Bloglines automatically converted HTML? My misunderstanding is from the apparent inconsistency, really. I don’t understand why it works for me but not for you. There must be a small difference somewhere that I can’t seem to pinpoint…

  22. Martin Neczypor remarks:

    Yeah, the all in the <head> works for me using BlogLiner too.

  23. Grant Palin remarks:

    Hmm. I seem to have solved the problem. I went into BlogLines and removed the subscription to that site, and then added the subscription again. And the link appears fine in my blogroll now. Weird.

  24. Andy remarks:

    Oh Crap!
    The Plugin doesn’t works.
    My hoster doesnt allows directly including of Webpages :(.

  25. Jona remarks:

    You’ll have to contact your host about that. It’s a configuration issue.

  26. gordsellar remarks:

    Um… I can’t seem to get single-folder display to work, which is strange because when I leave the folder config blank the whole set displays fine — but without displaying folder names.

    Has anyone else reported such a problem? The example I tried was “other places I post” from my public subs under the name “gordsellar”. It’s not working no matter how much I tweak.

  27. gordsellar remarks:

    Oh, and by the way, it’s still an excellent plugin. :)

  28. gordsellar remarks:

    I’ve updated to the new plugin but it seems the php function doesn’t call, either within post content (maybe it’s not supposed to) or within templates (like at the bottom of the sidebar on my front page). Why might that be?

  29. Jona remarks:

    You’ll need the Run PHP Wordpress plugin to run PHP within your posts. Once you install that plugin and enable PHP for that post, the PHP will be processed and show your blogroll.

  30. gordsellar remarks:

    Cool and wonderful! Thanks so much! This is rock ‘n’ roll.

  31. 天佑的自由天地 » Blog Archive » WordPress 2.0 Beta 1 試用感想 remarks:

    […] Blogliner […]

  32. Dave remarks:

    I’m getting an error, it looks like the $file = @file($url) line is not working. But if I try to access the $url from my browser it works fine.

  33. Dave remarks:

    Fixed it, just needed to change this:

    allow_url_fopen = On

    It was “Off” before by default in Gentoo

  34. Dave remarks:

    One small problem, the URLs have ampersands in them, but it should be &, in order to be XHTML 1.0 transitional compliant.

    What php code can I use to do this? There must be some function that already exists to do this.

  35. Jona remarks:

    Dave, you can use the following code to convert all &’s in a string into &amp;’s.


    $str = str_replace('&', '&amp;', $str);

    You can change the title of the blog you subscribed to through your Bloglines account to remedy the problem instead, though. (E.g., use “and” instead of using the ampersand.)

  36. Dave remarks:

    Jona,

    Using “and” instead of & won’t help. The ampersands are used to separate arguments in the URL in the usual way, not as part of the blog title.

  37. Jona remarks:

    Oh, I understand now, Dave. Thanks for the email. I’ll make the changes and issue an upgrade once I’ve tested it out. Thanks again.

  38. Dave remarks:

    I just tested 0.3 and it does generate XHTML 1.0 transitional compliant code for me. Thanks a lot Jona.

  39. Guimod Blog 镜象站 » 与WP2.0兼容的插件列表 remarks:

    […] A- C A Different Monthly Archive Script (www.oneofthosedays.org.uk/projects/plugin-archives) Adhesive (redalt.com/wiki/Adhesive) v3.0 Akismet (akismet.com/) 1.1 (Duh!) Akismet Spam Count (cavemonkey50.com/code/akismet-spam-count/) Angsuman’s Referrer Bouncer (blog.taragana.com/index.php/archive/word-press-1-5-plugin-referer-bouncer) Auto Links (www.headzoo.com/) Autohyperlink (journalphoenix.com/40/autohyperlink) Bad Behavior / Bad Behaviour (www.ioerror.us/software/bad-behavior/) Bad Behavior Stats (www.ajaydsouza.com/wordpress/plugins/bad-behavior-stats-plugin/) BlogLiner (www.slightlyremarkable.com/2005/05/introducing-blogliner) 0.2 Blogs Of The Day (blogsoftheday.com/) All Versions I assume. Brian’s Latest Comments (meidell.dk/archives/2005/03/21/brians-latest-comments-15/) 1.5.5 and 1.5.8 CA-StarDate (www.funponsel.com/blog/archives/2005/05/02/ca-stardate/) Cricket Moods (dev.wp-plugins.org/wiki/CricketMoods) CG-Amazon (www.chait.net/index.php?p=238/) CG-FeedRead (www.chait.net/index.php?p=238/) CG-Inline (www.chait.net/index.php?p=238/) CG-QuickPHP (www.chait.net/index.php?p=310/) Countdown (redalt.com/downloads/) Counterize (andersdrengen.dk/projects/counterize) 0.31 (Create wp_images directory in root) D - F del.icio.us - Bookmark this! (www.arnebrachhold.de/2005/06/05/delicious-bookmark-this-wordpress-plugin) 1.0 del.icio.us Cached (www.w-a-s-a-b-i.com/archives/2004/10/15/delisious-cached/) 1.4 Download Manager (guff.szub.net/download-manager/) R1.beta2 Dunstan’s Time Since (binarybonsai.com/wordpress/time-since/) 1.1 Editor Search (www.theoneandtheonly.com/wordpress-editor-search/) 1.3 Extended Live Archives (www.sonsofskadi.net/index.php/extended-live-archive/) 0.10 Beta-r5 Favatars (dev.wp-plugins.org/wiki/favatars) 2 flickrRSS (eightface.com/code/wp-flickrrss/) 2.3 Fold Page List (http://http://www.webspaceworks.com/resources/cat/wp-plugins/30/) 1.0.1 G - K Get Recent Comments (blog.jodies.de/archiv/2004/11/13/recent-comments/) Google Analyticator (cavemonkey50.com/code/google-analyticator/) 1.3+ Google Sitemaps (www.arnebrachhold.de/2005/06/05/google-sitemaps-generator-v2-final) 2.7.1 Gravatar (www.gravatar.com/implement.php#section_2_2) 1.1 Gravatars (www.skippy.net/blog/2005/03/24/gravatars/) 2.6 Headline Images (www.coldforged.org/image-headlines-plugin-for-wordpress-15/) Hello Dolly (wordpress.org/#) 1.5 (Duh!) Hirji Date (www.usayd.com/pluginshacks/hijri-date/) InScript (www.urbangiraffe.com/plugins/inscript/) 1.7 intouch (adahas.com/work/intouch/) 1.1 Intypo (mymykry.links-ab.de/kategorie/intypo/) Jalenack’s Wordspew (blog.jalenack.com/ajax/) 1.16 L - O Lazyest Gallery (lazyest.keytwo.net/) Tested 0.7.1 and 0.8 Links Page (www.asymptomatic.net/wp-hacks/) List Subpages (robm.me.uk/projects/plugins/wordpress/list-subpages/) LiveCalendar (www.jonabad.com/livecalendar/) Tested 1.8 and 1.8.5 Miniblog (mediumbagel.org/?page_id=16) MtDewVirus’ Most Commented (mtdewvirus.com/code/wordpress-plugins/) 1.02 MyNetflix (www.jimmyoliver.net/mynetflix-plugin/) Nice Categories (txfx.net/2004/07/22/wordpress-conversational-categories/) 1.5.1 No Ping Wait (somethingunpredictable.com/wp-no-ping-wait/) Now Reading (robm.me.uk/projects/plugins/wordpress/now-reading/) Obfuscate E-Mail (www.coffee2code.com/wp-plugins/#obfuscateemail) Optimal Title (elasticdog.com/2004/09/optimal-title/) P - S PJW Wordpress Version Check (blog.ftwr.co.uk/wordpress/wp-version-check) Popup Image Gallery (www.yellowswordfish.com/index.php?pagename=popup-image-gallery-plugin) 2.2 Post Teaser (dev.wp-plugins.org/wiki/PostTeaser) Qdig-WP (randomfrequency.net/wordpress/qdig/) 0.5 Quick Post (cjbehm.dyndns.org/wingingit/quick-post/) Random Header (www.martinet.nl/wp-site/random-header-plugin) Random Posts (www.w-a-s-a-b-i.com/archives/2004/05/27/wordpress-random-posts-plugin/) 1.1 McMike’s Random Quote (www.mcmike.nl/?page_id=40) Random Talk (http://http://mangasverdes.es/codigo-wp/random-talk) 1.0 MtDewVirus’ Recent Posts (mtdewvirus.com/code/wordpress-plugins/) 1.07 Redirect to Page (cavemonkey50.com/code/redirect-to-page/) Related Posts (www.w-a-s-a-b-i.com/archives/2004/05/26/wordpress-related-entries-plugin/) 1.3.3 (Had to update the database manually, but this is possibly due to a custom database prefix) Scrobbler (leflo.de/projekte/scrobbler/) 1.3 Scrobbles (robm.me.uk/projects/plugins/wordpress/scrobbles/) SearchHistory (andersdrengen.dk/projects/searchhistory) 0.17 Search Everything (dancameron.org/searcheverything/) 0.01 Search Pages (randomfrequency.net/wordpress/search-pages/) 0.1 Shire Reckoning (www.allyngibson.net/?p=335) 0.5 Sideblog (katesgasis.com/2005/10/24/sideblog/) SimpleSearch (beaucollins.com/notes/2005/11/19/simplesearch-a-simple-full-text-solution/) 1.0 SimpleTags (www.broobles.com/scripts/simpletags/) 1.1 (See #1618 (trac.wordpress.org/ticket/1618) — need to edit wp-admin/admin-header.php to allow tagging within posts) Smart Count (wp.marcosmedia.com.ar/plugins/smart-count/) Spam Karma 2 - Reloaded (unknowngenius.com/blog/wordpress/spam-karma) (Tested 2.1 Beta 1 and seems to work fine except for comment_count updates) comment_count updates are fixed by using this SK2 plugin - lair.fierydragon.org/2005/11/sk2-wp2compatibility/) StatCounter for WordPress (citizenk.wordpress.com/wp-plugins/statcounter-for-wordpress/) 1.0 Structured Blogging (www.structuredblogging.org/) Subscribe To Comments (txfx.net/code/wordpress/subscribe-to-comments/) 2.0.2 (May need to have his text strings redefined in options panel, but otherwise works fine) Ryan Boren’s Theme Switcher (boren.nu/archives/2004/10/13/theme-switcher-plugin/) (partially works : it disables the “Current theme option” admin link) T - V Textile 1 (www.huddledmasses.org/) Trackping Separator (notes.mk-notes.com/tsp) Ultimate Tag Warrior (www.neato.co.nz/ultimate-tag-warrior/) 2.8.7 (Applied this patch (www.neato.co.nz/forum/read.php?4,114,115#msg-115) to solve ” ” problem) Note : release 2.8.8 solves this problem no more patch needed Ultimate Tag Warrior (www.neato.co.nz/ultimate-tag-warrior/) 1.3 Legacy Ultimate Tag Warrior: Tag Archive (www.neato.co.nz/ultimate-tag-warrior/) 1.0 W - Z Weighted Categories (www.hitormiss.org/projects/weighted-categories) 1.2 Witty Text (www.w-a-s-a-b-i.com/archives/2004/05/27/wordpress-random-witty-text-plugin/) Weather.com Plugin (www.didcoe.id.au/?post_id=19) 1.5 WeatherIcon (www.viper007bond.com/wordpress-plugins/weathericon/) 2.3 WebSTAT Tracker (cavemonkey50.com/code/webstat-tracker/) WordPress Database Backup (www.skippy.net/blog/category/wordpress/plugins/wp-db-backup/) 1.7 WordPress Mobile Edition (www.alexking.org/index.php?content=software/wordpress/content.php#wp_120) WP Admin Bar 2 (mattread.com/archives/2005/03/wp-admin-bar-20/) WP-Amazon (manalang.com/wp-amazon/) WP-Cron (www.skippy.net/blog/category/wordpress/plugins/wp-cron/) 1.4 WP-Dash (somethingunpredictable.com/wp-dash) (Recent Posts widget causes database errors) WP-Dash World Time (www.viper007bond.com/wordpress-plugins/world-time-for-wp-dash) WP Flickr Post Bar (tantannoodles.com/toolkit/wp-flickr-post-bar/) 0.3 (does not work with the WYSIWYG on) -> Possible solution? (wordpress.org/support/topic/50093) WP Grins (www.alexking.org/index.php?content=software/wordpress/content.php#wp_120) (need to change path around line 34 to /wp-includes/images/smilies/ from the default of /wp-images/smilies/, otherwise fine) wp-icq-status (blog.tassoman.com/78,wp-icq-status) WP SpamAssassin (www.ioerror.us/software/wp-spamassassin/) WPG2 (wpg2.ozgreg.com/index.php/Main_Page) WordPress/Gallery2 integration - tinyMCE (the rich text editor) filters wpg2 tag […]

  40. Ahmed remarks:

    Excellent plugin. I highly recommend to bloggers. keep the good job!

  41. achill remarks:

    Good working!!

    I am proud be to Deaf :)

  42. Janio Sarmento remarks:

    Very useful and interesting plugin, but you might make it CURL-aware, because almost every host nowadays block fopen for URLs.

    I’ll try to modify the plugin by myself. If I succeed I’ll send the modified code to your evaluation. Thanks.

  43. Janio Sarmento remarks:

    Me again.

    Not that hard to make your plugin CURL-aware. :-)

    Where you have a call to @file($url) in the form


    if ($file=@file($url)){

    do the following:


    $ch = curl_init();
    $timeout = 0; // set to zero for no timeout
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $file_contents = curl_exec($ch);
    $url_close($ch);

    if ($file = explode("\n", $file_contents)){

    Instead of using the function file() you are now grabbing the URL from the Internet using CURL, and exploding it based on new line character.

    I hope this snippet can be useful for someone.

  44. Novo Blogroll » O Blogue do Janio remarks:

    […] Duas mudanças visuais no Blogue: o novo arquivo graças ao plugin (A Different Monthly Archive Script) e um novo blogroll, graças ao BlogLines e ao plugin BlogLiner, que faz o trabalho de buscar o os dados do meu blogroll público do Bloglines e formatá-los numa lista não-ordenada padrão do WordPress. […]

Leave a Remark

 

Note: HTML is allowed. (<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> ).