使用 Drupal,如何访问旧的、不再可用的提要条目?

Posted

技术标签:

【中文标题】使用 Drupal,如何访问旧的、不再可用的提要条目?【英文标题】:Using Drupal, how to get access to old, no longer available, feed entries? 【发布时间】:2010-12-15 05:46:39 【问题描述】:

我正在做一个项目,我被要求将来自不同网站的大量提要汇总到一个本地/可搜索的数据库中。项目/站点是基于 Drupal 的,旧的提要条目是项目的关键数据。我的问题是:

有没有办法使用 Drupal 访问旧的、不再可用的提要条目?如果不在 Drupal 中,是否有 php 方法可以实现这一点?

谢谢。

【问题讨论】:

【参考方案1】:

Drupal 中的 Drupal 提要聚合器模块是执行此操作的官方方法。

在设置中有一个选择标签“丢弃早于:”的项目,最多只能使用 6 周,但可以在自定义模块中使用以下方法覆盖:

function MYMODULE_form_aggregator_admin_settings_alter(&$form, &$form_state) 
  $form['aggregator_clear']['#options'][157784630]  = "Nearly Never aka 5 years";

如上所述here

这将自动为您抓取您的提要并将它们存储在 aggregator_item 表中

【讨论】:

非常有帮助。谢谢理查德 :)【参考方案2】:

另一种选择是成熟的http://drupal.org/project/feedapi 或更新的http://drupal.org/project/feeds,它们都旨在将提要解析为drupal 节点、用户等。

Feeds(下一代的feedapi)有以下有用的功能:

将数据导入或聚合为节点, 用户、分类术语或简单 数据库记录。

* One-off imports and periodic aggregation of content
* Import or aggregate RSS/Atom feeds
* Import or aggregate CSV files
* Import or aggregate OPML files
* PubSubHubbub support
* Create nodes, users, taxonomy terms or simple database records from import
* Extensible to import any other kind of content
* Granular mapping of input elements to Drupal content elements
* Exportable configurations
* Batched import for large files

祝你好运!

【讨论】:

以上是关于使用 Drupal,如何访问旧的、不再可用的提要条目?的主要内容,如果未能解决你的问题,请参考以下文章

Drupal - 在视图提要中公开过滤器

Drupal主题化RSS提要视图

Drupal 视图 2 提要显示将周围的 html 添加到项目

如何获取联系人可用的最大内存

SimpleXML - “节点不再存在”

如何使用drupal 7将所有值插入数据库