February 15, 2006

Using BlogBridge Reading Lists to build your Blog Roll

Filed under: Product Features — Aleksey Gureiev on 1:52 pm


Right after the reading lists publishing feature was released we started to intensively look for some new reading lists applications. One of the answers came from a sudden observation. I was clicking through one site when its sidebar grabbed my attention. There was a blogroll – the list of the blogs the author recommended.

Can you already feel what I’m getting at? In order to publish your reading list as a dynamically updated blogroll on the site all you need is a piece of JavaScript code. This code should render a small chunk of HTML containing the list of feeds from your reading list. And voila, you’ve got a dynamically updated blogroll following all your changes in BlogBridge.

Basic Usage

From now on you can access any of your published reading lists in a way which is very similar to that you use for getting OPML.

Here’s my Favorites reading list OPML link:

  http://www.blogbridge.com/rl/2/Favorites.opml

And now my Favorites JavaScript link:

  http://www.blogbridge.com/rl/2/Favorites.js

Noticed the extension change? Right, no other tricks.

In order to get any use of it you need this JavaScript file to be included somewhere on your site. Most often it will be a sidebar, but there could be other interesting solutions. Just type this script line anywhere you want and it will be replaced with generated HTML.

  <script src=”http://www.blogbridge.com/rl/2/Favorites.js”></script>

Two things to note here:

  • This script code contains a link to my favorites
  • You can’t replace <script …></script> with <script/> due to the problem in some browsers.

Displaying Tags

After a day of using this feature in my own blog I realized that it could be even better if I could show the tags I had given to my favorite blogs. It looks more friendly if there are couple of words behind every blog link describing why exactly it was added to my favorites.

By adding a query parameter “tags” you can tell our service that you are interested in having feed tags mentioned in the list.

  http://www.blogbridge.com/x/y.js?tags=true

It’s very simple, right?

Styling

As a Wordpress user, I have got the style almost right from the first try even without any style changes. Later, I decided to move tags a bit to the right to have them aligned with the blog names.

Let’s see what HTML code our JavaScript generates. It’s important for those who are interested in applying custom CSS rules to make the list fit better the overall site design.

Assuming that the reading list has two feeds:

  • Title “Feed A”, HTML URL “http://a.feed.com/”, tags “photo” and “stream”.
  • Title “Feed B”, HTML URL “http://b.feed.com/” and no tags.

the generated basic HTML will look like this:

   <ul class="bbrl">
     <li><a class="site" href="http://a.feed.com/">Feed A</a></li>
     <li><a class="site" href="http://b.feed.com/">Feed B</a></li>
   </ul>

and the HTML with tags included will look as follows:

   <ul class="bbrl">
     <li><a class="site" href="http://a.feed.com/">Feed A</a>
       <div class="tags">photo stream</div></li>
     <li><a class="site" href="http://b.feed.com/">Feed B</a></li>
   </ul>

Note that the second list item has no tags section because it has no tags. Again everything is very simple and straightforward.

Those familiar with CSS will have no difficulties with styling. For others, here’s what you might need:

   /** Moving a list slightly to the right and bottom. */
     .bbrl { margin-left: 10px; margin-top: 5px; }
   /** Adding space between list items */
     .bbrl li { margin-bottom: 5px; }
   /** Removing underlining of links. */
     .bbrl a.site { text-decoration: none; }
   /** Moving tags to the right. */
     .bbrl .tags { margin-left: 10px; }

Summary

Given the URL after the successful publication of your reading list (see Guide Properties -> Publication) you can easily make the JavaScript link to use for in-HTML access by replacing “.opml” with “.js” and adding optional parameters (”tags=true” is the only available for now).

Insert the following script tag into your HTML with your own JavaScript link. It will be replaced with a nicely formatted HTML display of the indicated Reading List.

  <script src=”http://www.blogbridge.com/rl/abc/xyz.js”></script>

Notes:

  • You can’t replace <script …></script> with <script/> due to a problem in some browsers.
  • Add “?tags=true” after “.js” to request that the feed tags also be included.
  • del.icio.us
  • digg
  • Netscape
  • Reddit
  • Slashdot
  • StumbleUpon
  • Furl

6 Comments »

  1. BlogBridge: Sidebar Reading List

    BlogBridge have now added a code to place your Reading List on your blog sidebar…if you don’t use BlogBridge for your Reading Lists, try OPML Renderer, OPod, or Bitty Browser…these last 2 can even read the feed content.

    Trackback by Library clips — February 16, 2006 @ 11:11 pm

  2. Where do you find your user-id?

    Comment by Andrew — February 17, 2006 @ 5:24 pm

  3. A slight error in the bottom notes it should be ?tags=true to get the tags to appear and not tags=yes as printed.

    Comment by Andrew — February 17, 2006 @ 7:43 pm

  4. Andrew, thanks for the “tags” parameter tip. I’ve updated the description to make it a little bit more clear. Basically, you don’t construct your JS link manually, you just take the link our service gave to you for OPML access to the published reading list and replace the extension “.opml” with “.js”. There’s no need to explicitly know your user-id. It’s crucial that this is perfectly understandable from the description, so let us know what else could we add/change to make it straightforward.

    Thanks and… Enjoy!

    Comment by Aleksey Gureev — February 18, 2006 @ 3:31 am

  5. Tech & Web Acronym of the Week: OPML

    I’m sure you know what HTML is. But what about OPML? BlogHer Hobbies editor Debra Roby says it makes her think of Oompa Loompas. It reminds me of my two-year-old’s request for “opa-meal” at breakfast time. OPML stands for Outline Processor Markup Language

    Trackback by BlogHer [beta] — February 27, 2006 @ 6:40 pm

  6. This visual anatomy is great. I am also a visual type, and the logic visually displayed makes sense for me, and helps a lot!

    Comment by Adam — August 5, 2007 @ 7:53 pm

RSS feed for comments on this post.

Leave a comment

Powered by WordPress