C# Blog Reader - 2 - Get data into an app
- Posted: Oct 26, 2012 at 9:50 AM
- 5,675 Views
- 15 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
In this video we'll build a set of classes to represent a blog post, a blog, and a collection of blogs that download RSS or Atom feeds from the Web using the SyndicationClient class.
Changes in the video as of 3/25/2013
public async Task GetFeedsAsync()
{
Task<FeedData> feed1 =
GetFeedAsync("http://blogs.windows.com/skydrive/b/skydrive/atom.aspx");
Task<FeedData> feed2 =
GetFeedAsync("http://blogs.windows.com/windows/b/windowsexperience/atom.aspx");
Task<FeedData> feed3 =
GetFeedAsync("http://blogs.windows.com/windows/b/extremewindows/atom.aspx");
Task<FeedData> feed4 =
GetFeedAsync("http://blogs.windows.com/windows/b/business/atom.aspx");
Task<FeedData> feed5 =
GetFeedAsync("http://blogs.windows.com/windows/b/bloggingwindows/atom.aspx");
Task<FeedData> feed6 =
GetFeedAsync("http://blogs.windows.com/windows/b/windowssecurity/atom.aspx");
Task<FeedData> feed7 =
GetFeedAsync("http://blogs.windows.com/windows/b/springboard/atom.aspx");
Task<FeedData> feed8 =
GetFeedAsync("http://blogs.windows.com/windows/b/windowshomeserver/atom.aspx");
// There is no Atom feed for this blog, so use the RSS feed.
Task<FeedData> feed9 =
GetFeedAsync("http://blogs.windows.com/windows_live/b/windowslive/rss.aspx");
Task<FeedData> feed10 =
GetFeedAsync("http://blogs.windows.com/windows_live/b/developer/atom.aspx");
Task<FeedData> feed11 =
GetFeedAsync("http://blogs.windows.com/ie/b/ie/atom.aspx");
Task<FeedData> feed12 =
GetFeedAsync("http://blogs.windows.com/windows_phone/b/wpdev/atom.aspx");
Task<FeedData> feed13 =
GetFeedAsync("http://blogs.windows.com/windows_phone/b/wmdev/atom.aspx");
Task<FeedData> feed14 =
GetFeedAsync("http://blogs.windows.com/windows_phone/b/windowsphone/atom.aspx");
if (feed.SourceFormat == SyndicationFormat.Atom10)
{
if (item.Content != null && item.Content.Text != null)
{
feedItem.Content = item.Content.Text;
}
if (item.Id != null)
{
feedItem.Link = new Uri("http://windowsteamblog.com" + item.Id); // just use feedItem.Link = new Uri(item.Id);
var matches = _feedDataSource.Feeds.Where((feed) => feed != null && feed.Title.Equals(title));
var matches = _feedDataSource.Feeds
.Where(group => group != null)
.SelectMany(group => group.Items).Where((item) => item.Title.Equals(uniqueId));
Already have a Channel 9 account? Please sign in
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Great video!
I don't really see why you do the null checks (would have used string.IsNullOrEmpty anyways), but if they are null, the feed fields you wanted to set is in most case null
Gonna start working on my Windows 8 app now, thanks for the kickstart!
I had a problem getting these feeds (mentioned around the 20:00 mark) to load properly in the app as described later in this demo series. I was able to make it work by changing all atom.aspx URLs to rss.aspx. Other than that, great series. I look forward to using what I learned here in the very near future.
Great video , but having one problem. when i right click on Rss Post, it is not showing "save target as". it showing only "save link as". if i downloaded as and save it. is it correct.? then it is not working like a .xaml file.
so please tell me from where i can get .xaml file of rss post.
The "high quality WMV" link is wrong... the file for the link is "Part20ImplementingTheSearchContract_Source.wmv"...
The "high quality WMV" link is wrong... the file for the link is "Part20ImplementingTheSearchContract_Source.wmv"...
can anyone help me am getting rss.aspx not rss.xaml file. please give me solution from where i can get.
when i right click on rss post it shows save link as not save target as. when i downloaded this file.it's rss.aspx not rss.xaml file.
Please give solution.
What browser are you using? Saving the file as RSS.aspx is fine, you'll notice that when you open it up, is it an XML file
Sorry about that, the video is correct if you download it, it's just that the label is wrong. I'll see what I can do to fix that
@Elroymam: I had the same problem too. As listed in http://blogs.windows.com/b/ , all feeds are now RSS only. Also the website changed its name
thank you for the great content .... i just fall in love of win 8 ... but i have the question .... when we give our app an XML file ... how it be regenerate or how the app can know that their's an update for these info or in other way how we can get " fresh info" each time while we put a single XML file ... ??
how can I make a sync feeddata from a playlist from youtube I've done it by retrieving the all videos from the total channel
thank i'm really thankful
Awesome video Dan, it is just what I've been looking for. \m/
What did you copy and pasted in public async Task GetFeedsAsync(){ } method?
I want to display youtube videos from a channel like that.
How can I do that?
What did you copy and pasted in public async Task GetFeedsAsync(){ } method?
I want to display youtube videos from a channel like that.
How can I do that?
@Dan: Thanks Dan for updating the video with the new links. I really had some problems in running code, that I commented on this episode and the next episode proposing changing the links. I even wrote a feedback on the MSDN article. Now I think the code should run out of the box, and problems should be resolved! and it even has atom feeds, so the author name would be visible in the app when viewed in later episodes!
Remove this comment
Remove this thread
close