XML Feed not Per Book?


#1

When working on the RegEx portion of this chapter I am running into a problem with the RegEx not matching all of the returned RSS content. My RSS request string is:

NSURL *url = [NSURL URLWithString: @"http://forums.bignerdranch.com/smartfeed.php" @"?limit=1_DAY&sort_by=standard&feed_type=RSS2.0&feed_style=COMPACT"];

…and when the server returns the data some of the titles don’t appear to match the format the book expects. When I NSLog the XML I see the following (abbreviated to save space - removed many elements not relevant to this issue):

<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.8.0-dev (info@mypapit.net)" -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>forums.bignerdranch.com</title>
        <description>Books written by Big Nerd Ranch</description>
        <link>http://forums.bignerdranch.com/smartfeed.php?limit=1_DAY&amp;sort_by=standard&amp;feed_type=RSS2.0&amp;feed_style=COMPACT</link>
        <lastBuildDate>Sun, 08 Jul 2012 18:47:35 GMT</lastBuildDate>
        <generator>FeedCreator 1.8.0-dev (info@mypapit.net)</generator>
		<atom:link href="http://forums.bignerdranch.com/smartfeed.php?limit=1_DAY&amp;sort_by=standard&amp;feed_type=RSS2.0&amp;feed_style=COMPACT" rel="self" type="application/rss+xml" />
		...        
		<pubDate>Sun, 08 Jul 2012 18:47:35 GMT</pubDate>
        <ttl>60</ttl>
        <item>
            <title>5. MapKit and Text Input :: Re: End of Chapter 5 foundLocation never fires :: Reply by ...</title>
 			...
        </item>
        <item>
            <title>6. Subclassing UIView and UIScrollView :: Re: My Bronze Challenge solution :: Reply by Pauley</title>
			...
        </item>
        <item>
            <title>6. Subclassing UIView and UIScrollView :: Concentric Circles Strange Occurence :: Author cannelloni</title>
            ...
        </item>
        <item>
            <title>6. Subclassing UIView and UIScrollView :: Set Backgrounds to Clear on page 130 looking for ...</title>
            ...
        </item>
        <item>
            <title>6. Subclassing UIView and UIScrollView :: Re: Set Backgrounds to Clear on page 130 looking for ...</title>
            ...
        </item>
        <item>
            <title>15. Subclassing UITableViewCell :: Silver Challgenge: performSelector: vs forwardInvocation: :: ...</title>
            ...
        </item>
        <item>
            <title>15. Subclassing UITableViewCell :: Re: Silver Challgenge: performSelector: vs forwardInvocation ...</title>
            ...
        </item>
        <item>
            <title>19. Object Instance Variables :: NSMutable array vs C++ Object array :: Author sushidot</title>
            ...
        </item>
    </channel>
</rss>

Notice that some of the item titles do not have the second “::” but instead appear truncated. Anyone else seeing this? Is this somehow tied to the “COMPACT” part of the URL?


#2

I see that sometimes the author part of the “title” element is simply not present.
There does seem to always be an “author” element.
I doubt it is intentional – that is, not intentionally directed to people who are trying
to learn from the book, but it is an extra wrinkle that we may need to work out.


#3

[quote=“mfromin”]
Notice that some of the item titles do not have the second “::” but instead appear truncated. Anyone else seeing this? [/quote]

Yes, I encountered that case too …
That would be an interesting silver challenge !


#4

See my solution at:

http://forums.bignerdranch.com/viewtopic.php?f=238&t=5670