rss

How do I parse and convert DateTime’s to the RFC 822 date-time format?

梦想与她 提交于 2019-11-27 03:49:56
How do I convert a DateTime structure to its equivalent RFC 822 date-time formatted string representation and parse this string representation back to a DateTime structure in .NET? The RFC-822 date-time format is used in a number of specifications such as the RSS Syndication Format . Try this: DateTime today = DateTime.Now; String rfc822 = today.ToString("r"); Console.WriteLine("RFC-822 date: {0}", rfc822); DateTime parsedRFC822 = DateTime.Parse(rfc822); Console.WriteLine("Date: {0}", parsedRFC822); The "r" format specifier passed into DateTime's ToString() method actually yields an RFC-1123

Best Way to read rss feed in .net Using C#

女生的网名这么多〃 提交于 2019-11-27 02:34:12
What is the best way to read RSS feeds ? I am using XmlTextReader to achieve this. Is there any other best way to do it? XmlTextReader reader = new XmlTextReader(strURL); DataSet ds = new DataSet(); ds.ReadXml(reader); After reading the RSS feed using XmlTextReader , is there any way I can populate data to ListItem instead of DataSet ? The System.ServiceModel.Syndication namespace has some stuff for you, namely the SyndicationFeed class. This is a fairly simple example. http://blogs.msdn.com/b/steveres/archive/2008/01/20/using-syndicationfeed-to-displaying-photos-from-spaces-live-com.aspx

How to parse CDATA HTML-content of XML using SimpleXML?

泄露秘密 提交于 2019-11-27 02:11:48
I am trying to display Xml content in to tables, all works perfectly but some content in the tag that i don't want to display, I want only image but not November 2012 calendar from 5.10 The Test like in xml, <content:encoded><![CDATA[<p>November 2012 calendar from 5.10 The Test</p> <p><a class="shutterset_" href='http://trance-gemini.com/wordpress/wp-content/gallery/calendars/laura-bertram-trance-gemini-145-1080.jpg' title='<br>November 2012 calendar from 5.10 The Test<br> <a href="</a></p>]]> </content:encoded> I want to display image but not November 2012 calendar from 5.10 The Test . <?php

Retrieving RSS feed with tag <content:encoded>

爷,独闯天下 提交于 2019-11-27 02:11:44
问题 I have the following snippet of code: function getFeed($feed_url) { $content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); echo "<ul>"; foreach($x->channel->item as $entry) { echo "<li><a href='$entry->link' title='$entry->title'>" . $entry->title . "</a></li>"; echo "<li>$entry->content</li>"; echo "</ul>"; } It works EXCEPT the $entry->content That part doesn't register. In the actual feed the tag is listed as <content:encoded> but I can't get it to feed. Any

Loading RSS feed with AJAX: alternatives to Google Feed API?

纵然是瞬间 提交于 2019-11-27 01:36:15
问题 I've been using the Google Feed API to load RSS feeds, but it looks like Google has shut down the API. For instance, when I try to load the New York Times RSS feed at http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&q=http%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FHomePage.xml , I get this response: {"responseData": null, "responseDetails": "This API is no longer available.", "responseStatus": 403} Are there any viable alternatives? 回答1: Use Yahoo's YQL API:

How Do I Fetch All Old Items on an RSS Feed?

牧云@^-^@ 提交于 2019-11-26 23:48:06
问题 I've been experimenting with writing my own RSS reader. I can handle the "parse XML" bit. The thing I'm getting stuck on is "How do I fetch older posts?" Most RSS feeds only list the 10-25 most recent items in their XML file. How do I get ALL the items in a feed, and not just the most recent ones? The only solution I could find was using the "unofficial" Google Reader API, which would be something like http://www.google.com/reader/atom/feed/http://fskrealityguide.blogspot.com/feeds/posts

Using SimpleXML to read RSS feed

那年仲夏 提交于 2019-11-26 22:33:26
I am using PHP and simpleXML to read the following rss feed: http://feeds.bbci.co.uk/news/england/rss.xml I can get most of the information I want like so: $rss = simplexml_load_file('http://feeds.bbci.co.uk/news/england/rss.xml'); echo '<h1>'. $rss->channel->title . '</h1>'; foreach ($rss->channel->item as $item) { echo '<h2><a href="'. $item->link .'">' . $item->title . "</a></h2>"; echo "<p>" . $item->pubDate . "</p>"; echo "<p>" . $item->description . "</p>"; } But how would I output the thumbnail image that is in the following tag: <media:thumbnail width="66" height="49" url="http://news

通过 XML 发布新闻

坚强是说给别人听的谎言 提交于 2019-11-26 21:28:30
通过 XML 发布新闻 发布日期: 10/26/2004 | 更新日期: 10/26/2004 Ted Roche 新的 RSS 新闻聚合频繁出现,这是因为越来越多的软件开发人员发现:无论是用于商业还是个人使用,该技术在 “ 语言表达 ” 方面确实有效。例如,一个程序员的网络日记可以为记录开发人员在最新项目或感兴趣的解决方案中感受到的喜悦或遇到的挑战提供一个很好的平台。在这篇 Ted Roche 在 4 月发表的 RSS 文章的续篇中,他展示了 Visual FoxPro 开发人员如何能够仅使用几个常用且功能强大的 VFP 命令来轻松地创建 RSS 聚合新闻。 在上个月有关 RSS 的文章中,我谈到了作为一个使用者来使用 RSS,手动读取和编写 RSS,订阅 RSS 聚合新闻以便在新闻阅读器中阅读,以及使用 blogging 软件发布 RSS。本文将探讨使用 Visual FoxPro 以编程方式生成 RSS。我将说明基本的格式,并讨论用 VFP 生成 RSS 的两种方法。 格式 RSS 的历史与很多特定标准类似,不同的团体获得绝对优势地位并声明其合理性,然后分裂并留下旧格式。实际上,现在有两种格式可以考虑:RSS 1.0 和 2.0。(第三个竞争者 Atom — 有争议,正如它的某些作者所坚持的,根本不是 RSS — 可能只是一种变体。它正处于早期开发阶段,目前的版本是 3.0

一直都不清楚RSS,照着一个C#的例子,随便写了一个,也不知道对不对!

拜拜、爱过 提交于 2019-11-26 21:28:29
1 Public en As String = Environment.NewLine 2 3 Public Function WriteRSSPrologue() Function WriteRSSPrologue( ByVal writer As XmlTextWriter) As XmlTextWriter 4 ' writer.WriteRaw("<?xml version=\""1.0\"" encoding=\""utf-8\"" ?>" + en) 5 ' writer.WriteRaw("<rss version=\""2.0\"">" + en) 6 ' writer.WriteRaw("\t<channel>" + en) 7 ' writer.WriteRaw("\t\t<title>""我想飞</title>" + en) 8 ' writer.WriteRaw("\t\t<link>""http://www.cnblogs.com/t_98dsky/ ""</link>" + en) 9 ' writer.WriteRaw("\t\t<description>Yet Another Forum Web Application RSS Feed</description>" + en) 10 ' writer.WriteRaw("\t\t<copyright

创建自己的RSS

為{幸葍}努か 提交于 2019-11-26 21:26:52
本文主要提供代码,创建自己的RSS,供别人订阅 --- RSS.aspx <% @ Page language = " c# " Codebehind = " RSS.aspx.cs " AutoEventWireup = " false " Inherits = " Socent.RSS " %> --- RSS.aspx.cs using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace Socent { /**/ /// <summary> /// 取得聚合文章 /// </summary> public class RSS : System.Web.UI.Page { Components.GenRSS gr = new Components.GenRSS(); // 实例化对象 string strRSS = "" ;