How do I syndicate my Urban Vancouver blog or other Urban Vancouver content on my website?
By Richard Eriksson on June 15, 2004 - 9:23pm
There are many reasons why you would want to feature Urban Vancouver content on your site:
1. It's an easy way to keep track of this site. The tips below work for other sites with RSS feeds too. Using syndication, you can create a page that aggregates your weblogs and other websites you visit the most if they offer XML feeds. That is essentially what the Urban Vancouver news aggregator does, although it uses more a more sophisticated approach than below.
2. You have an Urban Vancouver blog and would like to automatically link to your UV entries and/or have your articles' content show up on your site.
3. Increase your search-engine ranking for Vancouver-related terms. We don't mind being linked back as the original source for the material, since that increases our exposure—and the people and ideas we promote—too. Syndicating can be a win-win situation.
All Urban Vancouver blogs come with RSS feeds. If you look at the main feed in a regular browser, it might look funny, but it and the other feeds Urban Vancouver offers enable people to download content into software called a news reader or aggregator. They also allow people to easily syndicate content on other websites with links back to the original. You can add links to your weblog posts using your blog's RSS feed (or even the main feed or the many other feeds Urban Vancouver provides). For an example of a weblog's feed, you can look at my blog's feed.
If you have PHP on your server, the following solution is ideal, because it will look for new content every hour or so and add it to your site. (If you run a Movable Type weblog, of have neither and don't mind putting Javascript code in your website, see the instructions below.)
Syndicating Urban Vancouver Using PHP
You will first need to download the Magpie PHP RSS parser library [documentation and more information] and install it on your system. This requires some knowledge of extracting tar.gz files (tar -xvzf magpierss-0.xx.tar.gz is the magic command in Unix, replacing xx for the version of Magpie you downloaded), but once done, you can insert the following code into your sidebar or wherever you like. You can tweak the HTML as necessary.
<?php
require_once "./rss_fetch.inc";
$feed_url = "http://www.urbanvancouver.com/node/feed";
// change this URL to whichever XML feed you want
// to syndicate; the above is the main feed
$num_items = 10;
// maximum number of items to display
$rss = fetch_rss($feed_url);
$items = array_slice($rss->items, 0, $num_items);
print "<h4><a href=\"http://www.urbanvancouver.com/\">Urban Vancouver</a></h4>";
print "<ul>\n";
foreach ($items as $item) {
print " <li><a href=\"";
print $item['link'];
print "\">";
print $item['title'];
print "</a></li>\n";
}
print "</ul>\n";
?>
That's it. We appreciate the automatic links back to Urban Vancouver, and syndication helps you as well since it will help your search engine ranking for the keywords in our title. If you wish to syndicate our content even further than simple links, feel free to contact us for more information.
Syndicating Urban Vancouver Using Movable Type
For those who have a Movable Type weblog and aren't too sure about PHP (or want to minimize the amount of dynamic code on their website), this option will work for you. Unfortunately you will get the most recent content only after you rebuild your site, but it is still an effective way to syndicate our content.
For this, you will need the excellent MT-RSS plugin (be sure to check the documentation for the plugin's requirements) and put the following code in your index template:
<h4><a href="http://www.urbanvancouver.com/">Urban Vancouver</a></h4>
<MTRSSFeed file="http://www.urbanvancouver.com/node/feed">
<ul><MTRSSFeedItems lastn="10">
<li><a href="<$MTRSSFeedItemLink$>"><$MTRSSFeedItemTitle$></a></li> </MTRSSFeedItems></ul>
</MTRSSFeed>
You can change the second URL to whichever feed you wish to syndicate.
Other Methods of Syndicating Urban Vancouver
If you do not have Movable Type nor PHP, there are some online tools that will syndicate Urban Vancouver using Javascript. Most people have Javascript activated on their browsers, so it will normally show up for them. Cut n' Paste JavaScript RSS Feed automatically generates code that you can put on your site to link to Urban Vancouver. With this method, neither Urban Vancouver nor you will gain in terms of search-engine ranking with this method. We don't mind you using this method, however, but keep in mind that the advantages of the PHP and Movable Type methods—increased search-engine ranking—--are lost. Another thing to watch out for using the Cut n' Paste is that you need to input the full URL of the feed including http://.
Again, if you need help in syndicating our content, feel free to contact us.