Your First RSS Feed: Your First RSS Feed Lori Packer
Web Editor
University of Rochester
What is RSS? : What is RSS? RSS feeds (sometimes referred to XML feeds) are updated lists of headlines and articles that you can subscribe to and read using a free software application called a
feed reader or aggregator.
What is RSS?: What is RSS? RSS feeds (stands for "Real Simple Syndication" or "Rich Site Summary, depending on who you ask) allow you to gather all the news you are interested in from a variety of sources in one place, with updates sent to you automatically throughout the day.
Creating customized RSS feeds from search strings: Creating customized RSS feeds from search strings There are also several Web sites that allow you to create your own custom RSS feed based on a particular search string or query. For example, you could create a RSS feed for your university’s name, or a particular research term that interests you.
Creating customized RSS feeds from search strings: Creating customized RSS feeds from search strings Daypop (www.daypop.com)
Topix (www.topix.net)
FindArticles (www.findarticles.com)
Creating Your First RSS Feed: Creating Your First RSS Feed Some content management systems will generate feeds for you, and there are several RSS-creation tools (both free and not-so-free) available. But even without these tools, it’s easy to create an RSS feed yourself. There are two basic ways to approach your first RSS feed: you can bake it from scratch or connect to a database.
Bake it From Scratch : Bake it From Scratch All RSS feeds are in XML format. XML is a markup language, and as such it looks very similar to HTML; it uses tags to “mark up” content. But unlike HTML, in XML you can make up your own tags, and these tags don’t control the presentation or “look” of a site. They simply define and describe your content.
Bake it From Scratch: Bake it From Scratch With a few simple steps, you can create your first RSS feed from scratch. All you need is a text editor (eg. Notepad) and some compelling, frequently updated Web content.
Bake it From Scratch: Bake it From Scratch Declare the RSS version you’re using (2.0 is the latest) with the tag
Use the tag to begin your feed
Use the , , and tags to describe your feed as a whole (there are other optional tags that apply to your feed as a whole, like , , and )
Bake it From Scratch: Bake it From Scratch Start each item with the tag
Within each item, add a , , and
End each item with
End your feed with
End your file with
Save your files as an XML file (eg. sciencenews.xml)
Slide11:
University of Rochester : Humanities and Social Science Releases
Updated news from University Public Relations
http://www.rochester.edu/news/search.php?cat=humansocial
Copyright 2005 : University of Rochester
University of Rochester News
http://www.rochester.edu/news/prgraphic.gif
http://www.rochester.edu/news/
University Celebrates 20th Anniversary of Annual Viennese Ball
The Viennese Ball, one of the University of Rochester's most popular annual events, will be held from 9 p.m. to midnight on Saturday, Nov. 12, in Wilson Commons on the University's River Campus.
http://www.rochester.edu/news/show.php?id=2312
Fri, 28 Oct 2005 00:00:00 EDT
Talk on China's role in global business by David McHardy Reid
International business expert and strategist David McHardy Reid will discuss China's past 25 years of economic progress and how it may affect the future of global business at 2 p.m. Sunday, Nov. 13, in the Welles-Brown Room of Rush Rhees Library.
http://www.rochester.edu/news/show.php?id=2306
Thu, 27 Oct 2005 00:00:00 EDT
That’s it! : That’s it! Now upload your .xml file to your server and subscribe to your feed using your feed reader. Voila!
Connect to a Database : Connect to a Database Of course, it’s easy enough to create a feed like the one above. The trouble comes with maintaining and updating it. If you create your feed from scratch, you’ll be adding new items from scratch too. That can get very tedious very quickly.
Connect to a Database : Connect to a Database For folks whose Web content is already in a database, there’s good news. You can use PHP to generate your RSS feed automatically. Whenever a new item is added to your database, its entry is automatically added to your feed.
Connect to a Database: Connect to a Database Follow these steps: (as outlined in an excellent article from the excellent tiffanybrown.com)
Create the .htaccess file
First, you need to create or update your .htaccess file to tell the server to treat .xml files like PHP. Add this line to your .htaccess file:
AddType application/x-httpd-php .xml
All the .xml files in that directory will be treated as PHP.
Connect to a Database: Connect to a Database Set the header
Use the header() function to make sure your PHP send the text in your feed as XML and not HTML. Enter this line of code at the top of your file:
Connect to a Database: Connect to a Database Declare the RSS version your using (2.0 is the latest) with the tag
Use the tag to begin your feed
Set the basic feed using the same , , and tags as you would if you were baking from scratch.
Connect to a Database: Connect to a Database Retrieve the items from your database
First, you need to write a mySQL query that grabs the items you want to include in your feed.
This query grabs the reference number, headline, body text, and publication date for the most recent 10 releases with a category of “humanities and social sciences” and lists them in descending order by date.
Connect to a Database: Connect to a Database Next, you need to store the query results in an array. The next piece of code looks like this:
Connect to a Database: Connect to a Database Build the feed
Finally, you need to build the actual feed. In other words, you need to format the title, description, and link for each of the items you’ve grabbed from your database. That code looks like this:
http://www.rochester.edu/news/show.php?id=
No recent Press Releases found.
Connect to a Database: Connect to a Database End your feed with
End your file with
Save your files as an XML file (eg. sciencenews.xml)
Feed Readers : Feed Readers A feed reader or aggregator is a software program that you can download and then use to read your RSS feeds. There are also some Web-based feed readers that work inside your existing Web browser.
Feed Readers: Feed Readers Each feed reader is slightly different, but most have the same basic components: A list of feeds you're currently subscribed to, a list of headlines from the selected feed, and the full text of the selected item or headline.
Feed Readers: Feed Readers
Feed Readers: Feed Readers Feedreader (Windows only) — a nice, simple, free news reader that supports all formats of RSS feeds.
SharpReader (Windows only) — a more full-featured news reader that supports all RSS formats.
RSSreader (Windows only) — another simple RSS reader that supports all major formats.
NewsGator (Windows only) — a more full-featured news reader that can be accessed either over the Web or integrated with Microsoft Outlook.
NewsFire (Mac) — offers a simple interface and integration with iTunes for simple podcasting (the audio equivalent of RSS feeds).
AmphetaDesk (Mac or Windows) — a free application that downloads your feeds and displays them in a customizable Web page.
MyYahoo! — a Web-based news aggregator built into Yahoo!'s popular portal.
Feed Searches : Feed Searches So where do you find RSS feeds? The most common way is to look for the orange-and-white graphics on Web pages that provide RSS feeds of their content ( or ). Click on the graphic to find the URL and enter that URL into your reader.
Feed Searches: Feed Searches Most major news sites from traditional media outlets (New York Times, CNN, BBC, USA Today, NPR, Newsweek, and many many more) now offer RSS feeds. You can also search for RSS feeds using several online directories:
Yahoo! News
Feedster
Syndic8.com
Search 4 RSS