Consider this:
- Blogger can host your blog.
- Blogrolling lets you have an online blog roll, which in short is a list of links to blogs you are watching.
- XQuery The Web lets you run XQuery on a web page.
If your blog is on Blogger, and your blog roll is on Blogrolling, how can you show your blog roll in your blog? Blogrolling provides an RSS feed for your blog roll, but you cannot write server-side code on Blogger that would pull out data from that RSS feed and generate HTML. However, on Blogger you can include an external script with: <script language="javascript" type="text/javascript" src="http://...">.
That script can be dynamically generated to produce HTML based on the Blogrolling RSS feed. With XQuery The Web, you can do this in a couple of clicks:
- Go to XQuery The Web
- In the URL field enter the RSS link provided by Blogrolling.
- In the XQuery field, enter this query:
<ul> {for $i in /rss/channel/item return <li><a href="{$i/link}">{string($i/title)}</a></li> } </ul>
- Select the JavaScript radio button, and run the query.
- Copy the generated <script> tag and include it in your blog template where you want your blog roll to appear.
For instance, based on the RSS feed provided by Blogrolling, XQuery The Web generates JavaScript which is included in my personal blog.
There is an error in view description/view source translator page. However good stuff!
ReplyDeleteGood point. I will fix the links to the source.
ReplyDelete