Probably a dumb question but I specialize in those. Gotta go with your strengths…
By what method can you grab several different RSS feeds for display in the same content block on a page? I want to mix several feeds and order items by publish date, regardless of which feed they’re from. I see hints this is doable, but I don’t see how.
Cheers, Jack
I am doing this right now.
I created a channel/weblog for the kind of feed I was grabbing, which in my case was news_items, which has weblog_id =11. The custom fields correspond to the RSS specs (link, description, etc.).
I have a template called feeds that has the syntax for all of my feeds, one after the other. Each feed group has the parameter weblog=”11” in it.
When I render the template all of the feeds are grabbed and put into the same channel/weblog.
Within my template for viewing the news, I simply use the standard “entries” loop to sort and order by pubdate.
{exp:weblog:entries weblog="news_items" dynamic="off" disable="pagination|trackbacks|member_data" limit="7" status="open" orderby="date" sort="desc"}
<a href="http://{url_title_path=news_items/index}"> {exp:word_limit total="10"}{exp:html_strip}{title}{/exp:html_strip}{/exp:word_limit}</a> {related_entries id="item_source"}{if no_related_entries} {/if} <i> {channel_title} </i> {/related_entries}
In the code above, I am using the html_strip plugin to limit the length of the text in each entry to 10 words, and I am limiting the number of entries to 7. When you click on the hyperlinks created it goes to a single page display of the article.
The related entries loop does a relational database lookup to find the text I want displayed to indicate the source of the news item. So if it came from the Wall Street Journal, it says “WSJ” next to my headline in italics.
Hope that helps. Assuming it does, please know that you are the first person I have ever helped on this forum. Finally a question I could answer!
I shall happily steal…I mean learn from your code, and report back. 😉
Many thanks, Jack
Update: Your advice worked perfectly for pulling multiple RSS feeds into the weblog, and displaying them by date order. Many thanks for that!
I think I don’t quote follow the related_entries thing you’re doing to pull in the channel titles. Did this require adding a custom field for that value? I’m not sure how to map that since we’re already using an item title. And why is it a related entry? Obviously I’m missing something. If you have time to provide more details, that would be much appreciated.
Thanks, Jack
UPDATE II: After more testing I’m still unable to pull content from Atom feeds such as this one. The tag/item is called “content” but I end up with the word “Array” in my entry’s content field instead of the real content from the feed.
Has this ever been worked out? I’m having the same problem
Hi all,
Anyone know how to convert High ASCII Text that is imported via FeedGrab to Entities?
I’m getting strange characters like “’”. This appears correctly as ’ when I see the text in the EE admin, but rendered in a page, it appears as “’”.
I’ve got “Automatically Convert High ASCII Text to Entities” set to “Yes” in the Global Weblog Preferences”. So if an imported (FeedGrab) entry has the strange characters, I can go into “Edit”, save the entry and the issue is solved.
However, I don’t want to have to do this every time strange chars come up, so I’m looking for an auto solution. I’ve already tried “html_strip”, but it doesn’t help.
Great plugin by the way.
Hi Craig,
The format on the field was “none” before and I was able to open/edit an entry and re-save with the strange characters, to have it appear correctly.
I’ve just tried setting the field to XHTML, and then dropping in the character (in Twitter) in order to bring into my site via the feed, and it still has the same issue.
In case you can try this out, the character causing a problem is this:
’
And its converting to
’
Thanks
I have run into an issue with this module, been working absolutely fantastic so far but as of the 4th of Feb it stopped working.
I have found this error in the log
PHP Fatal error: Only variables can be passed by reference in /theoldergamers.com/httpdocs/cp/plugins/pi.feedgrab.php on line 1014
Line 1014 is the following:
$this->current_item[ $this->current_namespace ][ $el ], $text);
I’m no coder although it’s unlikely to be code related, maybe someone has encountered this before?
Thanks
I’m really excited about the potential of this plugin. But, I’m running into problems importing a Blogger feed.
My template:
{exp:feedgrab url="http://myfeed.blogspot.com/feeds/posts/default" weblog="1" title="title" date="published" use="content" fields="body" author="2"}
The errors:
Fetching: http://myfeed.blogspot.com/feeds/posts/default Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1536 Notice: Undefined offset: 8 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 9 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1541 Checking: Piece by Piece Found new entry: Piece by Piece Notice: Array to string conversion in /html/cp/plugins/pi.feedgrab.php on line 274 Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1536 Notice: Undefined offset: 8 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 9 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1541 Checking: New Tune Found new entry: New Tune Notice: Array to string conversion in /html/cp/plugins/pi.feedgrab.php on line 274 Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1536 Notice: Undefined offset: 8 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 9 in /html/cp/plugins/pi.feedgrab.php on line 1541 Notice: Undefined offset: 10 in /html/cp/plugins/pi.feedgrab.php on line 1541 […etc…]
The undefined offset doesn’t bother me. I think that’s because Blogger includes a decimal in the Seconds field, specifying down to the thousandths. (HH:MM:SS.SSS)
But, I get “Array” in the body field instead of the contents of the <content> element. I imagine this has to do with XML encoding (or lack of encoding) of reserved entities. Simply wrapping things in the EE XML-encode plugin doesn’t work (although that would be dreamy).
Help?
Hi Andrew
Thanks for a fantastic plugin! This will save me days of work (if I can get it fully working).
I’m using an RSS feed that I’ve created myself to import content from one website to another. Everything is working fine apart from my <description> field in the feed. For some reason that’s just not importing at all.
Here’s the content of my FeedGrab template:
{exp:feedgrab url="http://www.my-domain.com/feed/ee-feed.xml"
itempath="/rss/channel/item"
weblog="5"
author="1"
title="title"
date="pubDate"
use="price|city|region|listingtype|propertytype|reference|bathrooms|bedrooms|image1|image2|image3|image4|image5|image6|image7|image8|image9|description|preview"
fields="property_price|property_city|property_region|property_list_type|property_type|property_unique_ref|property_bathrooms|property_bedrooms|property_image1|property_image2|property_image3|property_image4|property_image5|property_image6|property_image7|property_image8|property_image9|property_description|property_preview"
unique="property_unique_ref"}
As you can see, I’m importing lots of fields. All work other than “description” and “preview” which are mapped to “property_description” and “property_preview” in EE.
These two fields are setup as textarea fields in EE with textile formatting (I’ve also tried xhtml), but as I say the fields are blank.
To give you some insight into the content of the description field, it’s mostly plain text. some contain french characters and some textile markup.
Any help much appreciated.
Jim
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.