rss

What is the best way to embed HTML in an RSS feed?

可紊 提交于 2019-11-30 20:27:24
I am using Django's RSS capabilities to build an RSS feed. The <description> of the RSS feed items contains HTML markup. Currently, I am just injecting the HTML markup into the feed using the following template: {{ obj.post }} Django, of course, translates special characters ( < , > , & , etc.) to their respective HTML entities. I know I could just output the HTML and wrap all the HTML code in <![CDATA[...]]> sections. This page says that either method is acceptable. If that's true, is there a good reason to pick one method over the other? And if I use example #2, is there a filter for Django

Yahoo YQL RSS - Bad Request

落爺英雄遲暮 提交于 2019-11-30 19:26:03
问题 For making cross-domain AJAX requests with jQuery, I am trying to use YQL RSS. select * from rss where url='https://www.top1000funds.com/feed/most-popular-posts/' My code: var feed = "https://www.top1000funds.com/feed/most-popular-posts/"; var yql = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22"+encodeURIComponent(feed)+"%22&format=json&diagnostics=true&callback=&rnd=_"+event.timeStamp; console.log(yql); $.getJSON(yql, function(res) { var html = '

Why can't RSS handle the ampersand?

只愿长相守 提交于 2019-11-30 18:38:17
When I come across a broken RSS feed, the usual reason its all blown to pieces is because line 23 says "Sanford & Sons." The most confusing thing is the fact that if you convert the & into & , all is well, even though your alternative still contains the problem character. Why does RSS fail at rendering the ampersand ( & ) character by default? Mitch Wheat When a 'raw' & is seen, the interpreter is looking for one of the valid escaped & sequences (such as '&' ). When an invalid sequence is found it throws an error. That's all there is to it. Because rss is an XML-based format and in xml the

Read rss feeds with c# mvc4

≡放荡痞女 提交于 2019-11-30 18:17:26
问题 this is my first post. So I have this problem and I'm very new to this language or c#. I have a model that reads the news rss, then using the same index controller I have to pass it to a view. This is my model: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web; using System.Xml.Linq; namespace Fantacalcio.Web.Areas.Admin.Models { public class FeedGazzetta { public string Title { get; set; } public string Description { get; set; } public

C# Get xml site over SSL/TLS - https://

江枫思渺然 提交于 2019-11-30 16:31:44
I need to be able to read xml/rss from a https web site in a console program. until now my program supports plain http, and i've been searching around but i cant seem to find an easy way to implement support for https. It would not matter if the site has a valid certificate or not, but i would appriciate to get hints towards how i would check these certificates to. I might not know too much about this so any hints are appriciated! what i currently do for http is: XmlTextReader rssReader; XmlDocument rssDoc; rssReader = new XmlTextReader(url); rssDoc = new XmlDocument(); rssDoc.Load(rssReader);

RSS feeds in PHP

一个人想着一个人 提交于 2019-11-30 15:41:33
问题 Just wondering if someone could suggest a PHP library that would allow me to read the data of an RSS feed and write it to a MySQL database. Also, if possible, provide a link to documentation about how to do this? Thanks 回答1: RSS is a pretty simple format - there is no great need to use a separate library. I'd just use simplexml, because I don't wanna spend the effort learning another library, and keeping up with its development. Here is a simple PHP script for showing the latest Stackoverflor

RSS feeds in PHP

こ雲淡風輕ζ 提交于 2019-11-30 15:11:12
Just wondering if someone could suggest a PHP library that would allow me to read the data of an RSS feed and write it to a MySQL database. Also, if possible, provide a link to documentation about how to do this? Thanks RSS is a pretty simple format - there is no great need to use a separate library. I'd just use simplexml , because I don't wanna spend the effort learning another library, and keeping up with its development. Here is a simple PHP script for showing the latest Stackoverflor posts with simplexml: <?php $rss = simplexml_load_file('http://stackoverflow.com/feeds'); ?> <h1><?php

Difference between description and content:encoded tags in RSS2

試著忘記壹切 提交于 2019-11-30 14:30:53
问题 What is the difference, if any, between the <description> tag and the <content:encoded> tag in RSS 2.0 format specifications? Is one more important than the other? Should I be using both in my feeds or one will suffice? 回答1: The <description> tag is for the summary of the post, but in plain text only. No markup. You can get around that if you escape the tags or wrap the content in: <![CDATA[ post body goes <strong>here</strong> ]> But you're not really supposed to be doing that. If you want

SyndicationFeed content:encoded

懵懂的女人 提交于 2019-11-30 14:04:20
问题 I’m using the SyndicationFeed class to consume some rss feeds. I am wondering how to get the content:encoded node of an RSS feed. This is the code I’m using: XmlReader reader = XmlReader.Create(response.GetResponseStream()); SyndicationFeed feed = SyndicationFeed.Load(reader); foreach (SyndicationItem item in feed.Items) { string title = (item.Title != null) ? item.Title.Text : String.Empty; string content = ?? string pubDate = (item.PublishDate != null) ? item.PublishDate.ToString("r") :

How to properly place Date in <pubdate> element on RSS feed

自古美人都是妖i 提交于 2019-11-30 14:02:13
问题 I'm using RSS Graffitty to post RSS items to a facebook page. The app told me the items were missing the publication date so I added this tag: echo "<pubdate>".$row['Date']."</pubdate>"; $row['Date'] is obtained from my MySQL database and it's a Datetime column. How must I format it/echo it so it's recognized by the RSS feed? Must I change the element? Thanks 回答1: RSS 2.0 specifications on the <pubDate> element should conform to the RFC 822 Date and Time syntax. Namely, to display it in the