我值得注意的是在服务器上使用 curl连接这个站点http://www.youm7.com/newtkarirrss.asp
但我可以从本地主机访问它没有任何问题
这是测试
http://www.tjreb.com/xml_grabber.php?feed=http://www.youm7.com/newtkarirrss.asp&stack=1
试试 CNN RSS 提要
http://www.tjreb.com/xml_grabber.php?feed=http://rss.cnn.com/rss/edition_meast.rss&stack=0
我怎样才能绕过这个错误
这是我的源代码
<?php
class xml_grabber
{
private $xml_file = '' ;
private $xml_link = '' ;
private $xml_dom = '' ;
private $xml_type = '' ;
private $xml_content = '' ;
private $xml_errors = array() ;
public $xml_stack = 0 ;
public function __construct($link_file_com = '')
{
if(!$link_file_com)
{
$this->xml_errors['construct'] = 'No Xml In Construct' ;
return false;
}
elseif(!function_exists('simplexml_load_file') || !function_exists('simplexml_load_string') || !function_exists('simplexml_import_dom'))
{
$this->xml_errors['functions'] = …Run Code Online (Sandbox Code Playgroud) 我正在Zend_Feed_Reader阅读提要,但是有问题。在某些提要中,我遇到了这个例外:Read timed out after 10 seconds我想减少时间。
因此,Zend_Feed_Reader在4秒内无法读取该提要的情况下,抛出了此异常。我不希望他尝试阅读10秒钟,如果他不能在4秒钟内阅读,那就放弃它。
这可能吗?
Google阅读器不会显示我的Atom Feed http://feeds.feedburner.com/CartesianClosedComic的图标.
根据互联网上的各种建议,这是我尝试的内容:
<icon>指向png图标的元素.(我也在.ico那里尝试了一个图标.)IMO,这本身应该足够了,但由于某种原因它不是.<link rel="shortcut icon" type="image/x-icon" />指向.ico图标的元素.<link rel="alternate" type="text/html" />指向具有favicon的网页的元素.以上都没有帮助.
我还发现了一个假设,即在域的根路径下应该有一个favicon(类似的东西http://mydomain.com/favicon.ico),但这对我来说不是一个选择.
有人可以推荐Node.Js模块或Javascript库(不基于可读性),可用于从网页和RSS源中提取内容吗?
我找到了一个可以完成这项工作的好的PHP库 - http://fivefilters.org/content-only/ - 但是寻找一个可以做同样事情的Node.Js模块.
谢谢!
我从几个 RSS feed joomla 模块中收到此错误。(下面是其中一个 LightRSSFeedReader 的示例,但我在尝试过的其他设备上也遇到了这个问题)
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /mnt/data/vhosts/casite-395567.cloudaccess.net/httpdocs/modules/mod_LightRSSFeedReader/tmpl/default.php on line 40
Notice: Trying to get property of non-object in /mnt/data/vhosts/casite-395567.cloudaccess.net/httpdocs/modules/mod_LightRSSFeedReader/tmpl/default.php on line 48
Run Code Online (Sandbox Code Playgroud)
第 40 行内容如下:$rss = DOMDocument::load("$rss_feed_url");
网上有一些讨论使用“->”而不是“::”,但只是简单地更改它(当然是覆盖),但这只会产生更多错误。
还有一些关于从http://php.net/manual/en/domdocument.load.php获取正确代码的信息,但我不知道如何使用“$rss”变量。
如您所知,我不是 PHP 程序员。
任何帮助都会受到广泛赞赏。
我想阅读 RSS 提要并存储它。为此我正在使用:-
<?php
$homepage = file_get_contents('http://www.forbes.com/news/index.xml');
$xml = simplexml_load_string($homepage);
echo '<pre>';
print_r($xml);
?>
Run Code Online (Sandbox Code Playgroud)
但首先我想检查一下
1.URL是否有效,即其响应时间是否为
$homepage = file_get_contents('http://www.forbes.com/news/index.xml');
Run Code Online (Sandbox Code Playgroud)
不到1分钟且url地址正确
2.然后检查文件(http://www.forbes.com/news/index.xml)是否有有效的XML数据。如果 XML 有效,则显示响应时间,否则显示错误。
我的问题的答案:
谢谢大家的帮助和建议,我解决了这个问题。为此我写了这段代码
<?php
// function() for valid XML or not
function XmlIsWellFormed($xmlContent, $message) {
libxml_use_internal_errors(true);
$doc = new DOMDocument('1.0', 'utf-8');
$doc->loadXML($xmlContent);
$errors = libxml_get_errors();
if (empty($errors))
{
return true;
}
$error = $errors[ 0 ];
if ($error->level < 3)
{
return true;
}
$lines = explode("r", $xmlContent);
$line = $lines[($error->line)-1];
$message = $error->message . ' at line …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Retrofit下载XML数据并使用Simple解析它,然后将其加载到ListView中.
不幸的是,下载的数据不会出现在屏幕上 有人能告诉我问题出在哪里吗?
这是我的模特:
@Root(name = "item")
public class Article {
@Element(name = "title")
private String title;
@Element(name = "author")
private String author;
@Element(name = "description")
private String description;
Run Code Online (Sandbox Code Playgroud)
接口代码:
public interface Service {
@GET("/rss/news")
public void getArticle(Callback<List<Article>> callback);
}
Run Code Online (Sandbox Code Playgroud)
片段代码:
public class ArticlePreviewFragment extends Fragment {
protected ArticlePreviewAdapter adapter;
protected List<Article> previewList;
private ListView listView;
public ArticlePreviewFragment() {}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
previewList = new ArrayList<>();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) …Run Code Online (Sandbox Code Playgroud) 我正在尝试阅读https:// d3ca01230439ce08d4aab0c61810af23:bla@mycon.mycompany.com/recordings.atom
使用罗马,但它给我错误
INFO: Illegal access: this web application instance has been stopped already. Could not load org.bouncycastle.jcajce.provider.symmetric.AES$ECB. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
Run Code Online (Sandbox Code Playgroud)
和
Server returned HTTP response code: 401 for URL: https://d3ca01230439ce08d4aab0c61810af23:bla@mycon.mycompany.com/recordings.atom .
Run Code Online (Sandbox Code Playgroud)
我这样做
URL url = new URL("https://d3ca01230439ce08d4aab0c61810af23:bla@mycon.mycompany.com/recordings.atom ");
try {
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = …Run Code Online (Sandbox Code Playgroud) iOS/Objective C有一个很好的RSS阅读器库吗?
我正在开发一个wp7应用程序,它是一个简单的rss阅读器.我能够恢复日期,标题和描述......
但是当我尝试从这个rss feed恢复一个图像时,我捕到一个NullReferenceException ...这里错误的行:
itemRss.Image = new Uri(item.Element("enclosure").Attribute("url").Value);
Run Code Online (Sandbox Code Playgroud)
那么,恢复图像的好指令是什么?提前致谢
我正在尝试使用 Django rss 提要在 rss 查看器应用程序上查看提要。
我用来django.contrib.syndication.views import Feed创建 RSS 提要
但它只有 3 个字段标题、描述和链接,我使用 from 添加了自定义字段 django.utils.feedgenerator import Rss201rev2Feed
它会毫无问题地生成额外的字段
但是当我用 rss 查看器打开它时,它不会显示那些额外的字段或图像
我的问题是如何让这些额外的字段显示在应用程序中?
它不显示是因为应用程序只显示标题、描述和链接而其他字段没有被处理吗?
那么我如何在描述中嵌入图像和其他字段以使其显示(最重要的是图像显示)?
我已经多次查看文档似乎无法正确处理。
这是来自 Django 应用程序的视图代码
class CustomFeedGenerator(Rss201rev2Feed):
def add_item_elements(self, handler, item):
super(CustomFeedGenerator, self).add_item_elements(handler, item)
handler.addQuickElement(u"image", item['image'])
handler.addQuickElement(u"seller_name", item['seller_name'])
handler.addQuickElement(u"price", item['price'])
class LatestPostsFeed(Feed):
title = "www.marktplaats.nl"
link = "/feeds/"
description = "Updates on changes and additions to posts published in the starter."
feed_type = CustomFeedGenerator
def items(self):
return Check_Ads_One.objects.order_by('title')[:5]
def …Run Code Online (Sandbox Code Playgroud)