Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Creating an RSS Reader?

Creating an RSS Reader?
Thread Tools
Baldrick
Fresh-Faced Recruit
Join Date: Nov 2003
Location: _-UK-_
Status: Offline
Reply With Quote
Apr 7, 2005, 06:06 AM
 
I would like to create my own RSS reader application for OS X using Cocoa and Xcode, but I do not have much experience in programing on the Mac.

I was wondering of anyone could point me in the direction of any decent online tutorials for 'building you own' RSS reader, or if anyone knows of any books that cover this topic.

Thanks in advance
12" PB revB
     
PBG4 User
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Apr 7, 2005, 08:25 AM
 
This site has links to many open source RSS reader projects in multiple languages (Perl, Smalltalk, Java) --> http://www.rssfeeds.com/readers.php . Got this from a simple Google search on 'open source RSS reader OS X'.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
poulh
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Apr 7, 2005, 12:43 PM
 
I haven't played with it, but I have seen an xml parser header file while poking around in one of apple's frameworks... you'll probably need that... easier than compiling an xml parser from the web.

Now... to get the xml from the web:

Safari uses an NSView subclass to render webpages. This view is available to you thru webkit (don't remember the name, but make a webkit app in xcode and you'll see it).

The displaying of the webpage and the fetching the webpage's html are done by two different objects (again, at work on my peecee or i'd give you the name, but look at the sample web browser in apple's examples to find it). You can have an instance of this fetching object w/out the part that renders the webpage. So...

You can use it to fetch a url then view the text from that url (this will be your xml), and then parse it and display it how you want to.

Good luck!
     
Baldrick  (op)
Fresh-Faced Recruit
Join Date: Nov 2003
Location: _-UK-_
Status: Offline
Reply With Quote
Apr 8, 2005, 06:10 AM
 
Thanks for the replies guys

Poulh - I'll be giving what you suggested a try today, it made quite a bit of sense to me so hopefully I'll able to get something working. Thanks very much for your help
12" PB revB
     
poulh
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Apr 8, 2005, 12:41 PM
 
Glad to help...

When designing the app you may want to consider making a separate object that goes out and gets the xml... then has methods like getHeading getLink getSummary that return the data.

Then make your rss app that uses the object. That way the interface is separate from the guts of the code.

An advantage to this is if say weather.com had an rss feed you could use the xmlGetter object to get the data and write a little weather monitor app on top that would look different from an rss reader.

Or you could make a screen saver that displayed rss headlines.

Re-usable code is a wonderful thing!
( Last edited by poulh; Apr 8, 2005 at 02:58 PM. )
     
beamso
Fresh-Faced Recruit
Join Date: Nov 2001
Location: Melboune, Australia
Status: Offline
Reply With Quote
Apr 10, 2005, 05:34 AM
 
The programmer behind NetNewsWire has some sample code for an RSS reader at http://ranchero.com/cocoa/rss/.
     
Baldrick  (op)
Fresh-Faced Recruit
Join Date: Nov 2003
Location: _-UK-_
Status: Offline
Reply With Quote
Apr 10, 2005, 12:32 PM
 
Thanks for that link, that is a great little app he has done.

I now thinking that I might use the Parser contained within that app for my own reader (as it is Open Source) saving me a lot of time and effort.

Just need to figure out how it works so I can pass it my URL's and call in things like the titles and headings into the relevant parts of my interface.

Thanks again
12" PB revB
     
poulh
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Apr 26, 2005, 01:23 AM
 
just found a function that will help you out..

in NSString
+ (id)stringWithContentsOfURLNSURL *)url;

will put the whole xml file into a string
     
RIRedinPA
Senior User
Join Date: Apr 2005
Status: Offline
Reply With Quote
Apr 26, 2005, 09:49 PM
 
Originally Posted by Baldrick
I would like to create my own RSS reader application for OS X using Cocoa and Xcode, but I do not have much experience in programing on the Mac.

I was wondering of anyone could point me in the direction of any decent online tutorials for 'building you own' RSS reader, or if anyone knows of any books that cover this topic.

Thanks in advance
For kicks I built an RSS reader using REALBasic and AppleScript - the AppleScripts ran some curl commands to get the XML which I then parsed in REALBasic - probably not the most efficient method but I was experimenting.
     
ambush
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
Apr 27, 2005, 09:41 AM
 
you might want to check out the new Syndication private framework in Tiger...
looks interesting to me.
     
poulh
Mac Enthusiast
Join Date: Jun 2000
Location: New York, NY
Status: Offline
Reply With Quote
Apr 27, 2005, 10:42 AM
 
Originally Posted by ambush
you might want to check out the new Syndication private framework in Tiger...
looks interesting to me.

ambush... you have any more details on what this is?

i think Baldrick is making the app to learn how to code.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Apr 27, 2005, 01:02 PM
 
Why bother using an unsupported private framework when existing sample code is widely available, and doesn't limit your userbase?
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:42 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,