这是一个由三部分组成的问题。我是 Android 新手,正在尝试创建一个新应用程序来读取 RSS 源并以widget.
感谢您的帮助!
我的divhtml中有以下内容
<div class="result">loading</div>
Run Code Online (Sandbox Code Playgroud)
我的javascript如下.
$(document).ready(function() {
$.ajax({
accept: 'application/rss+xml',
url: 'http://www.madhyamam.com/taxonomy/term/19/rss.xml',
success: function(data) {
$('.result').html(data);
}
});
});
Run Code Online (Sandbox Code Playgroud)
但由于某些原因......它似乎没有用.
XML返回(firebug):
XML解析错误:找不到元素位置:moz-nullprincipal:{9ec69805-af82-4f95-979a-f8e68d415124}第1行,第1列:
^
解决方案 *我再次使用雅虎管道传递问题.它工作得很好.*
我想使用Ruby的RSS类来解析Atom和RSS提要,因此我可以从中提取链接.如何区分代码中的两种类型?
我已经准备好了解析器响应.
response = RSS::Parser.parse(rss_url, false)
Run Code Online (Sandbox Code Playgroud) 在此示例 RSS 提要中,可选项目元素pubDate包含在所有条目中。但它不能作为 Python 模块feedparser 中的 item 元素使用。这段代码:
import feedparser
rss_object = feedparser.parse("http://cyber.law.harvard.edu/rss/examples/rss2sample.xml")
for entry in rss_object.entries:
print entry.pubDate
Run Code Online (Sandbox Code Playgroud)
导致错误,AttributeError: object has no attribute 'pubDate'但我可以成功执行print entry.description并查看所有描述标签的内容。
我正在开发一个网站,它将显示 RSS 提要中的最新项目。但是,每次用户访问该网站时,我希望页面显示缓存的数据。这将使页面显示得更快,因为我计划缓存 50 多个 RSS 提要。
我的问题是,如何缓存 RSS 提要,但确保它每 4 小时左右在后台更新一次?
提前致谢。
我正在尝试创建一个RSS feed解析应用程序,我是Android编程的新手.我目前有一个主活动,它会提示用户输入一个rss URL,以及所请求的rss feed的maxRows.我正在使用ROME库在Java中进行RSS feed解析.以下是我的代码:
package com.xetur.simplerss;
import java.io.IOException;
import java.net.URL;
import java.util.Iterator;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.sun.syndication.feed.synd.SyndContent;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
public class ListRowsActivity extends Activity {
private URL url;
private int maxRows;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_rows);
readFeed();
new Thread(new Runnable() {
public void run() {
readFeed();
}
}).start();
}
@SuppressWarnings("deprecation")
private void readFeed() {
XmlReader reader = …Run Code Online (Sandbox Code Playgroud) 我正在做一些RSS阅读器(在C#中,使用SyndicationFeed类).但我有一个问题.
当我阅读例如https://stackoverflow.com/feeds的提要时,它只是当天的提要!我怎么能读到前一天的饲料?
谢谢.
我想要做的是阅读rssfeed,所以我已经做了,但我显示为foreach循环,所以我怎么才能只显示5条记录?现在我获得了超过10条记录,但我只需要前5条记录,不管怎么说php,javascript或jquery只让它显示5条记录?
这是我读取rss文件的代码:
function getrssFeed($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'><h3>" . $entry->title . "</h3></a>" . $entry->pubDate . "<br /><br />" . strip_tags($entry->description) . "</li>";
}
echo "</ul>"; }
Run Code Online (Sandbox Code Playgroud)
getrssFeed("http://thestar.com.my.feedsportal.com/c/33048/f/534555/index.rss");
谢谢
我是Python的新手.我无法理解错误.我按照教程编写了代码.但它没有用
代码可在此链接中找到
我正在研究新闻应用程序,我需要解析当前的新闻RSS (Really Simple Syndication).
我找到了SimplePie库来RSS轻松解析feed.
首先,我直接在服务器上使用了这个库php code.
<?php
// Make sure SimplePie is included. You may need to change this to match the location of autoloader.php
// For 1.0-1.2:
#require_once('../simplepie.inc');
// For 1.3+:
require_once('./php/autoloader.php');
// We'll process this feed with all of the default options.
$feed = new SimplePie("https://news.google.com/news/feeds?pz=1&cf=all&ned=us&hl=en&topic=h&num=3&output=rss");
// Set which feed to process.
// Run SimplePie.
$feed->init();
// This makes sure that the content is sent to the browser as …Run Code Online (Sandbox Code Playgroud)