[WordPress] 外掛分享: Fetch Feed

前言介紹

  • 這款 WordPress 外掛「Fetch Feed」是 2009-01-21 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2009-08-11,距離現在已有 5751 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

jrtashjian |

外掛標籤

rss | cache | feeds |

內容簡介

此外掛是用來擷取與快取 RSS 資料以供在樣板中使用。

您可以傳遞您想要回傳的提要 (feed) 網址以及您想要快取的分鐘數。此外掛會將 RSS xml 快取並以物件的方式回傳,您可以透過迴圈的方式做進一步的處理,然後輸出在您的網站上。

版本 1.5 新增:
– 修正因為錯誤而每次都擷取並快取提要 (feed) 的問題。Credit: Binny V A (http://www.bin-co.com/blog/) – 謝謝他!

一般用法

fetch_feed_cache() 是此外掛唯一您需使用的函式。fetch_feed_cache() 接受 2 個參數:

(string) $url – 您想要解析的提要 (feed) URL
(int) $cache_min – 您想要快取的時間 (以分鐘為單位)

以下是此外掛在樣板中的實際範例:


channel->title?>




    channel->item as $item) : ?>
  • title?>



  • Delicious doesn't seem to be working at the moment...



請注意,每一個提要 (feed) 都可能不同。如果您需要查看回傳的物件結構,請使用 print_r()。
範例:

原文外掛簡介

This plugin was created to retrieve and cache an RSS feed for use in a template.
What you do is pass the url to the feed you would like returned and the number of minutes you would like the feed cached for. The
plugin will cache the RSS xml and return the feed as an object which you can loop through and output however you please.
New As Of Version 1.5:
– Fixed a typo that caused the feed to be retrieved and cached every time. Credit: Binny V A (http://www.bin-co.com/blog/) – Thanks man!
General Usage
fetch_feed_cache() is the only function you will be using with this plugin. fetch_feed_cache() accepts 2 parameters.

(string) $url – This is the URL to the feed you would like to parse
(int) $cache_min – This is the amount of time in minutes you would like the feed cached for.

Here is an example of the plugin being used in a template:

=$xml->channel->title?>


    channel->item as $item) : ?>
  • =$item->title?>

  • Delicious doesn't seem to be working at the moment...

Remeber, every feed could be different. If you need to see the structure of the object returned just use print_r().
Example:

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Fetch Feed」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.4 | 1.5 | trunk |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon