[OPLINTECH] RSS reader and integration

Aaron J. Bedra abedra@westervillelibrary.org
Mon, 24 Oct 2005 14:01:35 -0400


--=-XzWh5j7XaZcR1IJrZ3n7
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Karen && All,

Attached is a php script that I wrote to parse and display RSS Feeds in
a formatted table. Just replace the text (*the $file variable) at the
top of the script in upper case where the url goes and **presto you will
have rss incorporated into your page. 

If you wish to do feeds from multiple sites, this can be setup as a
class structure with an array of feeds that it pulls information from,
but this is just the static one feed script. 

I am using Apache and PHP 5.0.5-2 (but IIS works with php also)


*  reference line 8 of the code
** php installed and configured on your web server


Hope this helps,

Aaron J. Bedra
Westerville Public Library
614-882-7277 x114
abedra@westervillelibrary.org
http://www.westervillelibrary.org



On Mon, 2005-10-24 at 13:28 -0400, Karen Perone wrote:
> OK, I'm going to go out on a limb here and admit that I don't get this 
> whole RSS reader thing. I understand the concept of news feeds dropping 
> updated info onto your computer. I understand that the orange RSS box is 
> supposed to allow me to subscribe somehow. I also know that without a 
> reader of some sort, clicking on the orange box give me a screen of XML.
> 
> So, now what do I do? What readers do you folks use? Is there a simple 
> way to incorporate the news feeds with my local homepage that I use on 
> my browser?  Netscape 7.2 is my current with Firefox second and IE a 
> distant third choice.
> 
> Can I set up a blog or RSS feed for my library locally on an IIS box? Or 
> is it best to use an online site like blogger?
> 
> Help.
> --Karen Perone, Rodman Public Library
> 
> 
> _______________________________________________
> OPLINTECH mailing list
> OPLINTECH@oplin.org
> http://mail.oplin.org/mailman/listinfo/oplintech
> 

--=-XzWh5j7XaZcR1IJrZ3n7
Content-Disposition: attachment; filename=rss.php
Content-Type: application/x-php; name=rss.php
Content-Transfer-Encoding: base64

PHRkIHZhbGlnbj0ndG9wJyB3aWR0aD0iMTc1Ij4KCQk8dGFibGUgd2lkdGg9JzE3MCcgY2xhc3M9
J2NyZWF0ZV9wb3N0Jz4KCQk8dHI+CgkJCTx0ZCBiZ2NvbG9yPScjOTk5OTk5Jz48Y2VudGVyPjxm
b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