Posts Tagged ‘rss’

Creating RSS feeds with SimpleXML

Friday, August 22nd, 2008

I love RSS feeds. One just needs to take a look at my Google Reader to see that;

One of the best things about them is just how easy they are to make. Here is a quick example with PHP showing how you can create RSS feeds with the PHP5 module SimpleXML.

<?php

 

$items = array(

    array(

        "title" => "example",

        "pubDate"=>2,

        "link"=>"http://www.dougalmatthews.com"

        "description"=>"post content")

);

 

header("Content-type: text/xml");

 

$rssName = "My RSS Feed";

$rssHomePage = "http://www.dougalmatthews.com/";

$description = "My RSS feed description";

 

$sxe = simplexml_load_string("<rss version=\"0.91\">

<channel>

    <title>$rssName</title>

    <link>$rssHomePage</link>

    <description>$description</description>

</channel>

</rss>");

 

foreach($items as $item){

    [...]

Sharing your Google reader shared items

Saturday, July 12th, 2008

I use Google reader all the time, and its cool sharing items that you read about. The only problem is I don’t know many people that use Google Reader and therefore not that many of them see what I share.
So how can we get around this? Well I found out thanks to this website that you can get a RSS feed for your shared items! So I could just hand that out to people but, it would be nice to display it somewhere. So I thought why stop there? My url incase you want to know is:
http://www.google.com/reader/public/atom/user/01019558499128141290/state/com.google/broadcast
So, I then [...]