Webcast Follow up - Windows Live and RSS Data Binding Application Example

You Can Take it With You

Syndication

News

  • Don't miss the next Windows Mobile Webcast... Unit Testing for Mobile Devices: http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032382824&EventCategory=4&culture=en-US&CountryCode=US.

Thank you to everyone who attended Thursday's Webcast, Introducing Windows Live Services on Mobile Devices (Part 3 of 4): Combining Multiple Services into a Single Solution. We had another great turnout.

As promised here are the downloads

  • The RSS Data Binding Application we built. As you'll recall, using a list of RSS URLs, the app connects to the RSS feeds and loads them into a Typed DataSet. With the Typed DataSet, the application uses Databinding to populate controls showing the list of feeds, and when selected, the list of entries behind the feed.
  • The QnA RSS data - this includes the initial XML we downloaded and the XML Schema file we generated to create the Typed DataSet

 

For links to all 4 parts of series, they're posted here. Also, in the feedback section of that same post, there are some good follow up conversations that I encourage you to checkout.

Thanks again for attending the webcast (Live or On Demand) - I hope to see you at next week's Introducing Windows Live Services on Mobile Devices (Part 4 of 4): Managing Connectivity and Offline Behavior. It's scheduled for Thursday 25-Jan-2007 at 12-noon PST/3 PM EST/20:00 GMT.

 


Posted Jan 20 2007, 11:22 AM by jim-wilson

Comments

Andy wrote re: Webcast Follow up - Windows Live and RSS Data Binding Application Example
on 01-23-2007 9:47 AM
I just like to thank you for the webcast demo.
I like your approached xml and type dataset a lot. It makes thing so much simpler. I just wonder if you have any idea how to query all xml feeds base on category(i.e technology,etc...). I can only retrieve max of 10 question per category. Is there way I can control how many questions xml feed I can retrieve?

Andy
Jim Wilson wrote re: Webcast Follow up - Windows Live and RSS Data Binding Application Example
on 01-23-2007 4:47 PM
Andy;

I'm very happy to hear that the technique we worked through in the webcast works well for you.

Regarding the number of questions returned... As far as I can tell, the QnA system is fairly restrictive on this issue. As you may know, there is a &count=xx value you can put on the URL to set the number of returned questions but it only works if you set the count to 20 or less. Once you exceed a count of 20, the system always returns the default number of questions: 10.

I had hoped that maybe there’d be a way to retrieve ranges of values like questions 1 thru 10 or questions 50 thru 70. It turns out that QnA doesn’t seem to support this for RSS feeds. However, I have found a sort of hack that will allow you to get additional questions beyond the first 10. Keep in mind this is a hack :-)

QnA supports showing records in “pages” when rendering the data in HTML. For example, if you browse to http://qna.live.com/Browse.aspx?tag=cats&count=20 you’ll get back a nicely HTML formatted list of the first 20 questions and there will be a “Next” link at the lower right-corner of the page. The system seems to use a strange encoding for these “Next” links. For example, the “Next” link at the bottom of page 1 points to http://qna.live.com/Browse.aspx?tag=cats&count=20&c0=AAo=&c1=AAo=&page=1&d=U1Y/xw== . . Clicking that link then gives you questions 21 thru 40 nicely formatted as HTML. Interestingly if I put &format=rss on the end of this URL, I’ll get questions 21 thru 40 in RSS format. So it might be possible to hack the &c0, &c1, and &d fields in the URL. For example the &d field appears to be an identifier for the query because it’s the same on every page of the query but different for each query. I didn’t notice an obvious pattern for the values in the &c0 and &c1 fields although it may be there.

Remember I said that I came up with a hack and a hack it is. Using this information, one way to get to all the records is to request the data for page 1 in RSS format as usual, then browse to that same URL w/o setting the format to RSS (returns the HTML). You can then parse the returned stream to get the URL associated with the “Next” link. Browse to that URL with the &format=rss to get the next page of questions in RSS format. Then browse to that same URL without the &format=rss and parse the returned stream for the “Next” link and so on. So basically your paging through the questions like a user would with the browser but you also request each page as RSS for loading into the DatSet. It’s a super ugly solution but the best I’ve found at this point.

Sorry I can’t offer anything better right now. If anyone reading this knows a better solution, please share. Whenever I can track down a better solution I’ll post the answer here.

-Jim

Add a Comment

(required)  
(optional)
(required)  
Remember Me?