syndication-feed

SyndicationItem.Content is Null

巧了我就是萌 提交于 2019-12-05 13:38:27
问题 I'm trying to pull the contents of an RSS feed into an object that can be manipulated in code. It looks like the SyndicationFeed and SyndicationItem classes in .NET 3.5 will do what I need, except for one thing. Every time I've tried to read in the contents of an RSS feed using the SyndicationFeed class, the .Content element for each SyndicationItem is null. I've run my feed through FeedValidator and have tried this with feeds from several other sources, but to no avail. XmlReader xr =

How To Add A SyndicationElementExtension To A SyndicationItem

房东的猫 提交于 2019-12-05 04:40:22
Using the .NET System.ServiceModel.Syndication classes... I would like to add a new SyndicationElementExtension to a SyndicationItem that will export the following XML: <media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" /> Something along the lines of: syndicationItem.ElementExtensions.Add(new SyndicationElementExtension("thumbnail", "http://video.search.yahoo.com/mrss", ? How do you create a simple SyndicationElementExtension with a few attributes? Just to simplify for the next guy who comes along trying to figure this out, here's a working

How to create a SyndicationFeed with a custom namespace

空扰寡人 提交于 2019-12-05 02:58:01
问题 How can I generate Atom Feed which will contain the namespaces displayed in the image below? All the nodes of the Atom feed have to start with "a:". Here is what I am doing right now, however it doesn't work. SyndicationFeed feed = new SyndicationFeed(); XmlQualifiedName key = new XmlQualifiedName("os", "xmlns"); feed.AttributeExtensions.Add(key, "http://a9.com/-/spec/opensearch/1.1/"); Thanks! 回答1: I believe it should be SyndicationFeed feed = new SyndicationFeed(); XmlQualifiedName key =

Rss20FeedFormatter Ignores TextSyndicationContent type for SyndicationItem.Summary

与世无争的帅哥 提交于 2019-12-03 06:55:10
While using the Rss20FeedFormatter class in a WCF project, I was trying to wrap the content of my description elements with a <![CDATA[ ]]> section. I found that no matter what I did, the HTML content of the description elements was always encoded and the CDATA section was never added. After peering into the source code of Rss20FeedFormatter, I found that when building the Summary node, it basically creates a new TextSyndicationContent instance which wipes out whatever settings were previously specified ( I think ). My Code public class CDataSyndicationContent : TextSyndicationContent { public

How to get all possible image URLs from RSS feed item?

雨燕双飞 提交于 2019-12-01 20:46:04
I try to use this example to get images urls from http://www.nydailynews.com/cmlink/NYDN.Article.rss but no success Could u help me to find all correct ways to gets all possible image URLs from RSS feed item by SyndicationItem class? There is draft solution here but I guess should be more generic solution. Thank you! List<RssFeedItem> rssItems = new List<RssFeedItem>(); Stream stream = e.Result; XmlReader response = XmlReader.Create(stream); SyndicationFeed feeds = SyndicationFeed.Load(response); foreach (SyndicationItem f in feeds.Items) { RssFeedItem rssItem = new RssFeedItem(); rssItem

SyndicationFeed: Content as CDATA?

那年仲夏 提交于 2019-12-01 06:19:41
I'm using .NET's SyndicationFeed to create RSS and ATOM feeds. Unfortunately, I need HTML content in the description element (the Content property of the SyndicationItem) and the formatter automatically encodes the HTML, but I'd rather have the entire description element wrapped in CDATA without encoding the HTML. My (simple) code: var feed = new SyndicationFeed("Title", "Description", new Uri("http://someuri.com")); var items = new List<SyndicationItem>(); var item = new SyndicationItem("Item Title", (string)null, new Uri("http://someitemuri.com")); item.Content = SyndicationContent

Building a Simple RSS reader, retrieving content

痴心易碎 提交于 2019-12-01 05:02:55
问题 I am trying to make a simple RSS reader using SyndicationFeed class. There are some standard tags, like <title> , <link> , <description> ... there is no problem with them. But there are some other tags. for example, in this feed, which created by WordPress, there is <content:encoded> tag. I think there may be other tags for the content part of other websites. right? I want to know, how to find the main content of every post, is there any standards? which tags should I look for? (for example,

SyndicationFeed: Content as CDATA?

谁说胖子不能爱 提交于 2019-12-01 04:48:27
问题 I'm using .NET's SyndicationFeed to create RSS and ATOM feeds. Unfortunately, I need HTML content in the description element (the Content property of the SyndicationItem) and the formatter automatically encodes the HTML, but I'd rather have the entire description element wrapped in CDATA without encoding the HTML. My (simple) code: var feed = new SyndicationFeed("Title", "Description", new Uri("http://someuri.com")); var items = new List<SyndicationItem>(); var item = new SyndicationItem(

How do I read a secure rss feed into a SyndicationFeed without providing credentials?

坚强是说给别人听的谎言 提交于 2019-11-30 23:16:05
For whatever reason, IBM uses https (without requiring credentials) for their RSS feeds. I'm trying to consume https://www.ibm.com/developerworks/mydeveloperworks/blogs/roller-ui/rendering/feed/gradybooch/entries/rss?lang=en with a .NET 4 SyndicationFeed. I can open this feed in a browser and it loads just fine. Here's the code: using (XmlReader xml = XmlReader.Create("https://www.ibm.com/developerworks/mydeveloperworks/blogs/roller-ui/rendering/feed/gradybooch/entries/rss?lang=en")) { var items = from item in SyndicationFeed.Load(xml).Items select item; } Here's the exception: System.Net

Reading non-standard elements in a SyndicationItem with SyndicationFeed

点点圈 提交于 2019-11-27 10:57:00
With .net 3.5, there is a SyndicationFeed that will load in a RSS feed and allow you to run LINQ on it. Here is an example of the RSS that I am loading: <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <title>Title of RSS feed</title> <link>http://www.google.com</link> <description>Details about the feed</description> <pubDate>Mon, 24 Nov 08 21:44:21 -0500</pubDate> <language>en</language> <item> <title>Article 1</title> <description><![CDATA[How to use StackOverflow.com]]></description> <link>http://youtube.com/?v=y6_-cLWwEU0</link> <media:player url="http://youtube