spieFeed
Last updated Mar 10th, 2021 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$311 per month—let's make that $500!
Learn moreDescription¶
The RSS/Atom feeder based on SimplePie 1.2 which is already included in the package: http://github.com/rmccue/simplepie/downloads
Requirements¶
- MODX Revolution 2.0.0-RC-2 or later
- PHP5 or later
Download¶
It can be downloaded from within the MODX Revolution manager via Package Management, or from the MODX Extras Repository, here: https://modx.com/extras/package/spiefeed or here: https://modx.com/extras/package/spiefeed
Development and Bug Reporting¶
spieFeed is stored and developed in GitHub, and can be found here:https://github.com/goldsky/spiefeed
Bugs can be filed here: https://github.com/goldsky/spiefeed/issues
Usage¶
spieFeed is used by placing the Snippet call into your content and passing a 'url' parameter:
[[!spieFeed? &setFeedUrl=`http://path.com/to/my/rss.feed.rss`]]
For multiple sources can call this
http://feeds.feedburner.com/modx-announce | http://www.voanews.com/templates/Articles.rss?sectionPath=/russian/news
separated by pipe ( | ) symbol(s).
Available Properties¶
Name | Description | Options | Default |
---|---|---|---|
setFeedUrl | URL of the feed to retrieve. | Any URL | http://feeds.feedburner.com/modx-announce |
enableCache | This option allows you to disable caching all-together in SimplePie. However, disabling the cache can lead to longer load times. info | `0 | 1` |
enableOrderByDate | Sometimes feeds don't have their items in chronological order. By default, SimplePie will re-order them to be in such an order. With this option, you can enable/disable the reordering of items into reverse chronological order if you don't want it. info | `0 | 1` |
setCacheDuration | Set the minimum time (in seconds) for which a feed will be cached. info | integers in seconds | 3600 |
setCacheLocation | Set the file system location (not WWW location) where the cache files should be written. The cache folder should be make or error will be returned. info | core/components/spiefeed/cache | |
setFaviconHandler | Set the handler to enable the display of cached favicons. info | [str image handler file], [query] | false, "i" |
setItemLimit | Set the maximum number of items to return per feed with Multifeeds. This is NOT for limiting the number of items to loop through in a single fee For that, you want to pass $start and $length parameters to get_items(). info | integer | null |
setJavascript | Set the query string that triggers SimplePie to generate the JavaScript code for embedding media files. info | javascript query string parameter | js |
stripAttributes | Set which attributes get stripped from an entry's content. The default set of attributes is stored in the property SimplePie?strip_attributes, not to be confused with the method SimplePie?strip_attributes().This way, you can modify the existing list without having to create a whole new one. info | attributes get stripped from an entry"s content | array("bgsound", "class", "expr", "id", "style", "onclick", "onerror", "onfinish", "onmouseover", "onmouseout", "onfocus", "onblur", "lowsrc", "dynsrc") |
stripComments | Set whether to strip out HTML comments from an entry's content. info | `0 | 1` |
stripHtmlTags | Set which HTML tags get stripped from an entry's content. The default set of tags is stored in the property SimplePie?strip_htmltags, not to be confused with the method SimplePie?strip_htmltags(). This way, you can modify the existing list without having to create a whole new one. info | HTML tags get stripped from an entry"s content | array("base", "blink", "body", "doctype", "embed", "font", "form", "frame", "frameset", "html", "iframe", "input", "marquee", "meta", "noscript", "object", "param", "script", "style") |
dateFormat | Date format supports anything that works with PHP's date() function. Only supports the English language. info | PHP"s date() | "j F Y, g:i a" |
localDateFormat | Returns the date/timestamp of the posting in the localized language. Date format supports anything that works with PHP's strftime() function. To display in other languages, you need to change the locale with PHP's setlocale() function. The available localizations depend on which ones are installed on your web server. info | PHP"s strftime() of the posting in the localized language. setlocale() matters. | "%c" |
getItemStart | Returns an array of SimplePie_Item references for each item in the feed, which can be looped through. info | integers | 0 |
getItemLength | Returns an array of SimplePie_Item references for each item in the feed, which can be looped through. info | integers | 0 |
forceFSockopen | If cURL is available, SimplePie will use it instead of the built-in fsockopen functions for fetching remote feeds. This config option will force SimplePie to use fsockopen even if cURL is installed. info | `0 | 1` |
setInputEncoding | Allows you to override the character encoding of the feed. This is only useful for times when the feed is reporting an incorrect character encoding (as per RFC 3023 and Determining the character encoding of a feed). This setting is similar to set_output_encoding(). The number of supported character encodings depends on whether your web host supports mbstring, iconv, or both. See Supported Character Encodings for more information. info | http://simplepie.org/wiki/faq/supported_character_encodings | false |
setOutputEncoding | Allows you to override SimplePie's output to match that of your webpage. This is useful for times when your webpages are not being served as UTF-8. This setting will be obeyed by handle_content_type(), and is similar to set_input_encoding(). It should be noted, however, that not all character encodings can support all characters. If your page is being served as ISO-8859-1 and you try to display a Japanese feed, you'll likely see garbled characters. Because of this, it is highly recommended to ensure that your webpages are served as UTF-8. The number of supported character encodings depends on whether your web host supports mbstring, iconv, or both. See Supported Character Encodings for more information. info | http://simplepie.org/wiki/faq/supported_character_encodings | "UTF-8" |
sortBy | Allow you to sort the result by one of the available placeholders | placeholders | date |
sortOrder | The sorting order | ASC | DESC |
tpl | Template | chunk name | defaultSpieFeedTpl |
rowCls | Class name for each row | class name | spie-row |
firstRowCls | Class name for the first row | class name | spie-first-row |
lastRowCls | Class name for the last row | class name | spie-last-row |
oddRowCls | Class name for the odd row | class name | spie-odd-row |
&debug (1.5-pl) | Debug mode, to return Simple Pie's error | `0 | 1` |
&toArray (1.5-pl) | Return the result as an array | `0 | 1` |
&emptyMessage (1.5-pl) | Custom message on the empty return | anything |
Available Placeholders¶
- favicon
- link
- title
- description
- content
- permalink
- imageLink
- imageTitle
- imageUrl
- imageWidth
- imageHeight
- date
- localDate
- copyright
- latitude
- longitude
- language
- encoding
- authorName
- authorLink
- authorEmail
- category
- contributor
- getType
- itemImageThumbnailUrl
- itemImageWidth
- itemImageHeight
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$311 per month—let's make that $500!
Learn more