We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: FeedGrab

Development and Programming

Jack Brighton's avatar
Jack Brighton
58 posts
16 years ago
Jack Brighton's avatar Jack Brighton

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

       
craiguffman's avatar
craiguffman
100 posts
16 years ago
craiguffman's avatar craiguffman

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!

       
Jack Brighton's avatar
Jack Brighton
58 posts
16 years ago
Jack Brighton's avatar Jack Brighton

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

       
jeremydouglas's avatar
jeremydouglas
292 posts
16 years ago
jeremydouglas's avatar jeremydouglas
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

       
Mark Wushu's avatar
Mark Wushu
58 posts
16 years ago
Mark Wushu's avatar Mark Wushu

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.

       
craiguffman's avatar
craiguffman
100 posts
16 years ago
craiguffman's avatar craiguffman

I may be wrong, but I thought the “convert High ASCII TEXT to Entities” function only worked if you set formatting on the field to XHTML. I rely on that feature and it works wonderfully for me when I take feeds via feedgrab.

       
Mark Wushu's avatar
Mark Wushu
58 posts
16 years ago
Mark Wushu's avatar Mark Wushu

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

       
jeremydouglas's avatar
jeremydouglas
292 posts
16 years ago
jeremydouglas's avatar jeremydouglas

Mark,

I’m having this same problem, have you made any progress? I’m going to be troubleshooting some more over next couple days…

       
Mark Wushu's avatar
Mark Wushu
58 posts
16 years ago
Mark Wushu's avatar Mark Wushu

Hi Jeremy,

No, I’m afraid not. I haven’t had any more time to look further into it, and have just resigned myself to check for the characters and just re-save if required. Would be interested in seeing if you find out a solution!

Thanks,

Mark

       
Cville Matt's avatar
Cville Matt
3 posts
16 years ago
Cville Matt's avatar Cville Matt

We use the tags module on our newspaper website and I wanted to know if it is possible to get Feedgrab to supply values to that module? That would be a big help in automating some content.

       
stefaandk's avatar
stefaandk
5 posts
16 years ago
stefaandk's avatar stefaandk

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

       
iconolith's avatar
iconolith
1 posts
16 years ago
iconolith's avatar iconolith

I have the same question as Cville Matt… is there any way to capture tags from feed items so that they work with existing EE tags (from the EE Tag module)?

       
Michael Rog's avatar
Michael Rog
179 posts
16 years ago
Michael Rog's avatar Michael Rog

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?

       
Jim Pannell's avatar
Jim Pannell
187 posts
16 years ago
Jim Pannell's avatar Jim Pannell

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

       
Jim Pannell's avatar
Jim Pannell
187 posts
16 years ago
Jim Pannell's avatar Jim Pannell

Hey everyone - just wondered whether anyone had any suggestions for what might be my problem with the the FeedGrab plugin (see my post above)? I’m keen to get this working and would love to hear from anyone with any insight.

Thanks in advance,

Jim

       
First 12 13 14 15 16 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.