Your First RSS Feed

Information about Your First RSS Feed

Published on September 29, 2007

Author: Peppar

Source: authorstream.com

Content

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 <rss> tag Use the <channel> tag to begin your feed Use the <title>, <description>, and <link> tags to describe your feed as a whole (there are other optional tags that apply to your feed as a whole, like <copyright>, <image>, and <webMaster>) Bake it From Scratch:  Bake it From Scratch Start each item with the <item> tag Within each item, add a <title>, <description>, and <link> End each item with </item> End your feed with </channel> End your file with </rss> Save your files as an XML file (eg. sciencenews.xml) Slide11:  <rss version="2.0"> <channel> <title>University of Rochester : Humanities and Social Science Releases</title> <description>Updated news from University Public Relations</description> <link>http://www.rochester.edu/news/search.php?cat=humansocial</link> <copyright>Copyright 2005 : University of Rochester</copyright>   <image> <title>University of Rochester News</title> <url>http://www.rochester.edu/news/prgraphic.gif</url> <link>http://www.rochester.edu/news/</link> </image> <item> <title>University Celebrates 20th Anniversary of Annual Viennese Ball</title> <description>The Viennese Ball, one of the University of Rochester&#39;s most popular annual events, will be held from 9 p.m. to midnight on Saturday, Nov. 12, in Wilson Commons on the University&#39;s River Campus.</description> <link>http://www.rochester.edu/news/show.php?id=2312</link> <pubDate>Fri, 28 Oct 2005 00:00:00 EDT</pubDate> </item> <item> <title>Talk on China&#39;s role in global business by David McHardy Reid</title> <description>International business expert and strategist David McHardy Reid will discuss China&#39;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.</description> <link>http://www.rochester.edu/news/show.php?id=2306</link> <pubDate>Thu, 27 Oct 2005 00:00:00 EDT</pubDate> </item> </channel> </rss> 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: <? header('Content-type: text/xml'); ?> Connect to a Database:  Connect to a Database Declare the RSS version your using (2.0 is the latest) with the <rss> tag Use the <channel> tag to begin your feed Set the basic feed using the same <title>, <description>, and <link> 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. <? $getItems = "SELECT refno, headline_press_release, body, UNIX_TIMESTAMP(publication_date) AS pubDate FROM releases WHERE live = 1 AND subject_humansocial = 1 ORDER BY publication_date DESC LIMIT 10"; $result = mysql_query($getItems); ?> 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: <? $num_rows = mysql_num_rows($result); if($num_rows !=0) { while ( $myrow = mysql_fetch_array($result) ) { $refno = $myrow["refno"]; $headline_press_release = $myrow["headline_press_release"]; $body=strip_tags($myrow['body']); $body=substr($myrow10['body'],0,300); $publication_date = strftime("%a, %d %b %Y %T %Z",($myrow["pubDate"])); ?> 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: <item> <title><?print htmlspecialchars($headline_press_release,ENT_QUOTES);?></title> <description><?print htmlspecialchars($body,ENT_QUOTES);?></description> <link>http://www.rochester.edu/news/show.php?id=<?print $refno;?></link> <pubDate><?print $publication_date;?></pubDate> </item> <? } } else { ?> <p>No recent Press Releases found.</p> <? } ?> Connect to a Database:  Connect to a Database End your feed with </channel> End your file with </rss> 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

Related presentations


Other presentations created by Peppar

Financial Statement Analysis
10. 04. 2008
0 views

Financial Statement Analysis

Dr PH Presentation
07. 08. 2007
0 views

Dr PH Presentation

Burj Al Arab
22. 04. 2008
0 views

Burj Al Arab

cd4 hiv dr a singh
17. 04. 2008
0 views

cd4 hiv dr a singh

Philip Scott
17. 04. 2008
0 views

Philip Scott

RMIT 25July01 Pres
14. 04. 2008
0 views

RMIT 25July01 Pres

060125
13. 04. 2008
0 views

060125

Blomqvist
09. 04. 2008
0 views

Blomqvist

Rocks and Weathering
20. 09. 2007
0 views

Rocks and Weathering

Switzerland
15. 10. 2007
0 views

Switzerland

t infantil y legislacion
22. 10. 2007
0 views

t infantil y legislacion

14501
07. 10. 2007
0 views

14501

MAHA Talk
29. 10. 2007
0 views

MAHA Talk

Stylish Sentences
02. 11. 2007
0 views

Stylish Sentences

15 GardnerHarris
19. 11. 2007
0 views

15 GardnerHarris

cryptorchidism
19. 11. 2007
0 views

cryptorchidism

geometry and art P2
22. 11. 2007
0 views

geometry and art P2

Green Bldgs and WQ
31. 12. 2007
0 views

Green Bldgs and WQ

paper2
03. 01. 2008
0 views

paper2

Earthquakes Chap 5
20. 09. 2007
0 views

Earthquakes Chap 5

Ch08
20. 09. 2007
0 views

Ch08

El Paso Electric lowres pics
07. 08. 2007
0 views

El Paso Electric lowres pics

AG presentation Infrastructure
07. 08. 2007
0 views

AG presentation Infrastructure

GCRA Presentation 2005 1
07. 08. 2007
0 views

GCRA Presentation 2005 1

Asian Alphabet Book 04 17 06
07. 08. 2007
0 views

Asian Alphabet Book 04 17 06

pres maldives
07. 08. 2007
0 views

pres maldives

Tsunami Effects
07. 08. 2007
0 views

Tsunami Effects

Maldives
07. 08. 2007
0 views

Maldives

Global gs pp 0207
22. 10. 2007
0 views

Global gs pp 0207

feist ch14McCrae
06. 08. 2007
0 views

feist ch14McCrae

measurement and geometry
07. 08. 2007
0 views

measurement and geometry

arguments
15. 11. 2007
0 views

arguments

Tidal Energy Overview7
07. 08. 2007
0 views

Tidal Energy Overview7

camoa presse spip 01
07. 08. 2007
0 views

camoa presse spip 01

PE Rocks Igneous
20. 09. 2007
0 views

PE Rocks Igneous

ROCKS and how to identify them
20. 09. 2007
0 views

ROCKS and how to identify them

RIPARWIN Presentation
03. 01. 2008
0 views

RIPARWIN Presentation

ioag9 jaxa briefing
03. 01. 2008
0 views

ioag9 jaxa briefing

social structure
19. 02. 2008
0 views

social structure

investing in the future
04. 03. 2008
0 views

investing in the future

Secondary Math Handout
07. 08. 2007
0 views

Secondary Math Handout

Roundtable
26. 10. 2007
0 views

Roundtable

NicholasEberstadt
15. 10. 2007
0 views

NicholasEberstadt

YTB 052007
12. 03. 2008
0 views

YTB 052007

raicevic
18. 03. 2008
0 views

raicevic

sbp 07
25. 03. 2008
0 views

sbp 07

purchasing sp presentation
20. 09. 2007
0 views

purchasing sp presentation

CSAPA Awareness2005
07. 08. 2007
0 views

CSAPA Awareness2005

FinalReport
22. 10. 2007
0 views

FinalReport

IJCDlineNojiri
09. 10. 2007
0 views

IJCDlineNojiri

DFT KeyChallengesNicNewm an
05. 10. 2007
0 views

DFT KeyChallengesNicNewm an

ILejarraga
07. 08. 2007
0 views

ILejarraga

EP Tecon 0405
19. 06. 2007
0 views

EP Tecon 0405

famigliaim presaanto 3
18. 06. 2007
0 views

famigliaim presaanto 3

Bulldogs Best Books 1211
18. 06. 2007
0 views

Bulldogs Best Books 1211

btw e 008 moriresearch
18. 06. 2007
0 views

btw e 008 moriresearch

BPL Sanyo JV Pressrelease
18. 06. 2007
0 views

BPL Sanyo JV Pressrelease

bite overview
18. 06. 2007
0 views

bite overview

biogas
18. 06. 2007
0 views

biogas

BILBAO
18. 06. 2007
0 views

BILBAO

Benef oport
18. 06. 2007
0 views

Benef oport

formazrete
18. 06. 2007
0 views

formazrete

lect 4 1113 Class Ig Rx1
20. 09. 2007
0 views

lect 4 1113 Class Ig Rx1

ebs2 elearn07
19. 06. 2007
0 views

ebs2 elearn07

boiron
18. 06. 2007
0 views

boiron

fiscal
18. 06. 2007
0 views

fiscal

12 productivity quiz
16. 06. 2007
0 views

12 productivity quiz

10 1
16. 06. 2007
0 views

10 1

215 Pics With Captions
16. 06. 2007
0 views

215 Pics With Captions

2007 Power Stroke
16. 06. 2007
0 views

2007 Power Stroke

20070422
16. 06. 2007
0 views

20070422

20070225
16. 06. 2007
0 views

20070225

2005AM LC 2C
16. 06. 2007
0 views

2005AM LC 2C

2004 4082OPH1 01 Tiefer
16. 06. 2007
0 views

2004 4082OPH1 01 Tiefer

1kanrap
16. 06. 2007
0 views

1kanrap

1kanpres
16. 06. 2007
0 views

1kanpres

1kanintro
16. 06. 2007
0 views

1kanintro

1kancom
16. 06. 2007
0 views

1kancom

19 Flake 071706
16. 06. 2007
0 views

19 Flake 071706

OIF Presentation Final Sept07
05. 01. 2008
0 views

OIF Presentation Final Sept07

12nightacts
16. 06. 2007
0 views

12nightacts

Fri 0830 RegionalAQ liao 1 pc
16. 10. 2007
0 views

Fri 0830 RegionalAQ liao 1 pc

bullismo
18. 06. 2007
0 views

bullismo

ARVs friends or foes McCoy
28. 12. 2007
0 views

ARVs friends or foes McCoy

Rock types silica sat
20. 09. 2007
0 views

Rock types silica sat

Threats to our Water
29. 02. 2008
0 views

Threats to our Water

SIVplanmeet svg3c Shakir
07. 08. 2007
0 views

SIVplanmeet svg3c Shakir

Rajesh Mehta
07. 08. 2007
0 views

Rajesh Mehta

FER 9 und 20
18. 06. 2007
0 views

FER 9 und 20

georgevidor
16. 11. 2007
0 views

georgevidor

beo presentation
18. 06. 2007
0 views

beo presentation

EVACAR Otesis
18. 06. 2007
0 views

EVACAR Otesis

Calvin Dude
07. 08. 2007
0 views

Calvin Dude

PRACTICAL4
29. 12. 2007
0 views

PRACTICAL4

cuamcfarland
20. 09. 2007
0 views

cuamcfarland

UHART
24. 11. 2007
0 views

UHART

News CIRIA document
01. 01. 2008
0 views

News CIRIA document

EverythingDigital
07. 08. 2007
0 views

EverythingDigital

ntra Master B
23. 10. 2007
0 views

ntra Master B

FSGDevCon20060419
15. 11. 2007
0 views

FSGDevCon20060419

Context06
15. 10. 2007
0 views

Context06

4 brittle I
20. 09. 2007
0 views

4 brittle I

WBTi
07. 08. 2007
0 views

WBTi

BTSA Technology Bytes
18. 06. 2007
0 views

BTSA Technology Bytes

FCP05 PD Flaum
06. 08. 2007
0 views

FCP05 PD Flaum

14 20H 10 1103 Dr SEARO
07. 08. 2007
0 views

14 20H 10 1103 Dr SEARO

echt Zeit
19. 06. 2007
0 views

echt Zeit

dortmund
19. 06. 2007
0 views

dortmund