splittingred / getfeed Goto Github PK
View Code? Open in Web Editor NEWA simple snippet to retrieve an RSS feed and iterate the feed items using a Chunk.
Home Page: http://svn.modxcms.com/docs/display/ADDON/getFeed
A simple snippet to retrieve an RSS feed and iterate the feed items using a Chunk.
Home Page: http://svn.modxcms.com/docs/display/ADDON/getFeed
getFeed is missing a idx placeholder which you can use in your tpl to number the different entries.
Just adding the line
$modx->setPlaceholder("idx",$itemIdx+1);
right before the chunk output is generated will give it to you (this will number the items from 1...n).
I posted this in the modx support forum as well - please forgive the cross post.
Issues/Gotchas:
When I look at this rss feed (dutch news)
http://www.nu.nl/feeds/rss/binnenland.rss
then you see an enclosure tag inside every item. It would be great if this one is also available in the chunk for the getFeed items. Maybe could be default; that every tag-attributes are available as tag.attributename.. so the enclusore tag is available as enclusore and attributes like enclosure.url
Cache does not appear to be clearing with use of getFeed (Modx Revolution 2.8.3-pl). Though the RSS feed is updating at the URL used in the 'url' parameter, web content has not updated accordingly with use of Snippet call as shown below. Replacing URL with a different URL does not always update web content after saving. Is there a specific format that the URL must follow for the cache to clear? Are query strings allowed in the URL as in the example below? Is https (vs. http, as used in documentation) acceptable? Please let me know if additional info is needed. Created issue in revolution as well, and can close it in either repo as needed.
[[!getFeed? &url=`https://path.com/to/my/events/event/?feed=feed` &tpl=`RSSFeedParser`]]
Not sure if this is getFeed or output filter that's at fault, but using the code from the Addons doc you get a display that says the tweet was posted 40 years 8 months ago, irrespective of when it was actually posted (using :date=%c
seems to indicate the string is the right date, so I might be filing this in the wrong place, sorry).
Hi
I had the (maybe exotic) problem that a feed was oddly sorted (not by date). To handle this I modified the getFeed Snippet to accept a &sortby and a &sortdir parameter. &sortby allows to sort by any of the 'fields' that are available as placeholders. It also handles 'nested' fields found in RDF feeds (e.g.: dc.date).
I thought I could share it here. The modified code is found here: http://pastebin.com/QF3wttVp
getFeed 1.0.0 beta2,Revolution 2.0.0-rc-3 rev7061.
It's return ???????????? for utf-8 encoded feeds (for example try http://modxcms-jp.com/rss.html or http://community.modx-cms.ru/rss/allcomments/ ).
Quick fix is to add this line to snippet code:
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
By default it is set ISO-8859-1
Hope this is the right place to post this, but multiple feed aggregation would be a godsend!
perhaps we should better adding caching system (as a file or as a database), and time out limit.
I was hoping that this feeder could strip HTML like simplepie does here http://simplepie.org/wiki/reference/simplepie/strip_attributes
I'm facing the multiple
in one of my usage.
Has anyone been able to get getFeed to correctly parse a blog feed from a clean install of the latest WordPress (v.3.0.1)? getFeed is functioning fine for other sample feeds, but I am running into magpie parse errors related to the WordPress feed?
(ERROR @ /modx/revolution/core/model/modx/xmlrss/rssfetch.class.php : 242) User warning: MagpieRSS: Failed to fetch http://localhost/modx/revolution/blog/?feed=rss2 (HTTP Response: HTTP/1.0 301 Moved Permanently)
NOTE: This is the same error whether I have "FURLs" enabled for WordPress or not...
Would be nice to be able to have a firstClass, lastClass properties to be able to define.
Then two placeholders [[+classes]] and [[+classnames]] as in getResources to use in the tpl chunk
Upgraded site to use PHP 8.1 and MODX 2.8.6 however, unfortunately those pages which are running getFeed fail to load. When getFeed is disabled page loads, or if I downgrade PHP to 7.4 then works.
Hi,
this feed
generates a
[2012-11-04 15:30:12](ERROR in getFeed @ /Users/multimedia3/Sites/ba/core/cache/includes/elements/modsnippet/13.include.cache.php : 48) Error parsing RSS feed at https://picasaweb.google.com/data/feed/base/user/108218182177660842131/albumid/5632151548598894385?alt=rss&kind=photo&hl=en_US
error message in the console.
Thanks
The following error messages were all caused by getFeed (we documented the whole issue and attempts to resolve it, but its in a private forum ...)
Here are the error messages:
Receiving the following error messages (alternately)
1.
Fatal error: Out of memory (allocated 11796480) (tried to allocate 40961 bytes) in /home/sebweb/sebweb-modx-core/model/modx/modscript.class.php on line 48
(related to XPDO)
Fatal error: Out of memory (allocated 11796480) (tried to allocate 55125 bytes) in /home/sebweb/sebweb-modx-core/xpdo/cache/xpdocachemanager.class.php on line 925
When logged into the MODx manager, if I "save" a resource or an element, the website becomes accessible and loads without issue.
As soon as the home page is "requested" a second time, I get the following error message:
Fatal error: Out of memory (allocated 11796480) (tried to allocate 40961 bytes) in /home/sebweb/sebweb-modx-core/model/modx/modscript.class.php on line 48
1.
If I attempt further "refreshing of the home page, I get the following error message:
Fatal error: Out of memory (allocated 11796480) (tried to allocate 14332 bytes) in /home/sebweb/sebweb-modx-core/model/modx/modparser.class.php on line 87
When logged into the MODx manager, I can navigate the website (with the same browser) with absolutely no issues. No error messages, no page crashing, everything works perfectly.
I didn't manage to parse Atom or RSS2.0 feed of my installation of Status.net here http://aide-en-info.net/status/api/statuses/public_timeline.atom public or private feed (here: http://aide-en-info.net/status/api/statuses/user_timeline/1.atom )
While same feeds are correctly parsed with identi.ca [using the same software](here http://identi.ca/api/statuses/public_timeline.atom)
Thanks
Tried to pull in my flickr feed via:
http://api.flickr.com/services/feeds/photos_public.gne?id=81938914@N00&lang=en-us&format=rss_200
Line 24 of the snippet is returning false.
I started to investigate but wasn't sure how these services were implemented in revolution.
If I set the limit to 2 it does fetch 3 items, this is because PHP starts with counting on 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.