1 of 11
1
Plugin: FeedGrab
Posted: 29 August 2006 07:49 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

The aim of this plugin it to allow you to grab data from RSS feeds and insert it into your own weblog.

The motivation behind it is to produce something similar to http://www2.jeffcroft.com/tumblelog/ where various sources of 3rd party information are brought together in a single place. On a simpler level it could be used to import links to, say, your flickr images so that the image appears as part of your weblog, on the correct day.

The plug in has only been tested for my own purposes, but I’m posting it here in case any one else might find it useful.

Basic usage is:

1) Create a new template

2) Add a call to the plugin, eg:

{exp:feedgrab url=“http://api.flickr.com/services/feeds/photos_public.gne?id=25509357@N00&format=rss_200”
weblog=“1”
title=“title”
date=“dc:date.Taken”
use=“link|description”
fields=“extended|body” }

(This tells the plugin to grab the feed and for each item in the feed put its link and description in the weblog entry’s extended and body custom fields, using the feed item’s title as the entry title and its dc:data.Taken field as the entry’s publish date. The weblog parameter allows you to specify which weblog to put the data in.)

3) Call the template, either by hand or through a cron job

A known issue is that it breaks the Plugin Manager! I’m pretty sure that this is because it ‘shares’ code with the magpie plugin. Any help to get around this would be appreciated…


Edit: Please see the FeedGrab page to download current version

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 25 September 2006 11:14 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  11-15-2005

Awesome!  This is just what I have been looking for.  Will it work with Atom feeds?

Thanks for sharing this plugin.

 Signature 

Andrea Schwandt-Arbogast

work: Humboldt State University Web Office
personal: Interllectual.com
community project: Jangly Ganglia

Profile
 
 
Posted: 01 October 2006 01:41 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

This plugin is totally awesome, and just what I was looking for to duplicate some of my Flickr photos on my photolog!

The only problem I have spotted with it so far, is that it sometimes creates duplicate entries. Not for everything, but maybe every other entry or so. The first time it shows up in the RSS feed, it gets added fine. But if I then run the plugin again at a later date, when there are new items in the feed as well as old items, it will add some of the old items as new entries *again*, even though they already exist within EE. The title and date are still exactly the same for them - any ideas why it would be adding some as duplicate entries? It’s a pain having to weed through it every time to delete the duplicate entries!

In case it helps any, I am using this RSS feed (linked from this page):

http://api.flickr.com/services/feeds/photos_public.gne?id=95239135@N00&tags=stillburningcom&format=rss_200

And here is an example of the output I got when it created several duplicate entries, while adding a few new ones as well:

Fetching: http://api.flickr.com/services/feeds/photos_public.gne?id=95239135@N00&tags=stillburningcom&format=rss_200
Checking: St. Malachy's Church
Date: 2004-05-23T02:59:00 +0100 (2004-05-22T17:59:16-08:00)
Found: St. Malachy'
s Church
Checking
: St. Anne's Cathedral Detail
Date: 2004-05-27T22:35:00 +0100 (2004-05-27T13:35:40-08:00)
Found: St. Anne'
s Cathedral Detail
Checking
: Mount Stewart
Date
: 2004-08-13T03:36:00 +0100 (2004-08-12T18:36:44-08:00)
Found: Mount Stewart
Checking
: St. Anne Cathedral
Date
: 2004-05-27T22:45:00 +0100 (2004-05-27T13:45:28-08:00)
Found: St. Anne Cathedral
Checking
: St. Anne's Cathedral
Date: 2004-05-27T22:34:00 +0100 (2004-05-27T13:34:59-08:00)
Found: St. Anne'
s Cathedral
Checking
: Stairs
Date
: 2004-11-20T00:26:00 +0000 (2004-11-19T16:26:46-08:00)
Found: Stairs
Checking
: My Street Sign
Date
: 2004-05-17T00:21:00 +0100 (2004-05-16T15:21:00-08:00)
Found: My Street Sign
Checking
: Greenhouse
Checking
: Mural
Date
: 2004-05-27T22:07:00 +0100 (2004-05-27T13:07:07-08:00)
Found: Mural
Checking
: Falls Library
Date
: 2004-05-27T21:52:00 +0100 (2004-05-27T12:52:07-08:00)
Found: Falls Library
Checking
: Dirty White
Date
: 2004-05-23T03:09:00 +0100 (2004-05-22T18:09:50-08:00)
Found: Dirty White
Checking
: B&W Shed
Date
: 2004-06-14T22:53:00 +0100 (2004-06-14T13:53:23-08:00)
Found: B&W Shed
Checking
: Dry Boat
Date
: 2004-07-27T23:07:00 +0100 (2004-07-27T14:07:51-08:00)
Found: Dry Boat
Checking
: Barn
Date
: 2004-07-29T21:27:00 +0100 (2004-07-29T12:27:23-08:00)
Found: Barn
Checking
: Bobby Sands
Date
: 2004-05-27T21:52:00 +0100 (2004-05-27T12:52:35-08:00)
Found: Bobby Sands
Checking
: armedmural
Date
: 2004-05-27T22:19:00 +0100 (2004-05-27T13:19:29-08:00)
Found: armedmural
Checking
: Belfast Castle
Date
: 2004-05-26T21:10:00 +0100 (2004-05-26T12:10:01-08:00)
Found: Belfast Castle
Checking
: Sunbeam & Beach
Date
: 2005-02-25T23:42:00 +0000 (2005-02-25T15:42:32-08:00)
Found: Sunbeam & Beach
Checking
: St. Anne's Cathedral Inside
Date: 2004-05-27T22:39:00 +0100 (2004-05-27T13:39:58-08:00)
Found: St. Anne'
s Cathedral Inside
Checking
: Snowy Car
Date
: 2005-02-27T17:50:00 +0000 (2005-02-27T09:50:44-08:00)
Found: Snowy Car

Other than that, thanks a ton for creating this plugin! :D

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 02 October 2006 03:24 AM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005
asarbogast - 25 September 2006 11:14 PM

Will it work with Atom feeds?

It should work with Atom feeds. It uses the Magpie RSS library (version 0.6a) which claims to support RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 03:38 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005
Sasha - 01 October 2006 01:41 AM

The only problem I have spotted with it so far, is that it sometimes creates duplicate entries.

I’m sure there will be more problems than that!

Rather than checking for duplicate entries by title, the plugin attempts to look for entries created more recently than the previous time the plugin was called. This doesn’t seem to work very well, especially across different timezones and with daylight savings. It also requires the site that generates the feed gets its timestamp right, which I’ve noticed doesn’t always happen.

I’ll see if I can improve the method of checking for duplicates.

Many thanks for your feedback.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 03:41 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

Thanks Andrew! For me personally, checking on entry title would be perfect - or possibly a combination of entry title and entry date…my photos would sometimes have the same title, but they’d all have different “taken on” dates, even if it’s just by minutes or seconds. smile If you need someone to do some testing, please don’t hesitate to let me know!

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 02 October 2006 04:34 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005
Sasha - 02 October 2006 03:41 AM

checking on entry title would be perfect - or possibly a combination of entry title and entry date

This version checks title and entry date. Its relatively untested, but doesn’t do anything dangerous - it just checks for matching titles and dates before adding a new entry.

Andrew

Edit: Please see the FeedGrab page to download current version

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 06:19 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12372
Joined  04-29-2002

Andrew, does this new version still break the plugin manager?

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 02 October 2006 06:37 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

Yes, the plugin manager still breaks.

I’m pretty sure it is because the plugin manager uses the same Magpie RSS code as the FeedGrab plugin. It would be nice to share the Magpie plugins code somehow, but I could code around this, I guess.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 07:20 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

OK, another update…

I think this fixes the problem with the plugin manager not showing. The RSS code is still duplicated between this plugin and the Magpie one, but FeedGrab now checks to make sure it doesn’t redeclare the same functions (which was causing the error).

File Attachments
pi.feedgrab.0.5.3.zip  (File Size: 21KB - Downloads: 391)
 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 07:21 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12372
Joined  04-29-2002

You really do need to fix that. smile I use the plugin manager all the time, so not being able to get to it is a major problem.

Edit: Works now! Thanks for fixing it.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 02 October 2006 07:32 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005
Sue Crocker - 02 October 2006 07:21 AM

Works now! Thanks for fixing it.

Thanks for the feedback, Sue.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 02 October 2006 12:04 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  216
Joined  11-04-2002

Andrew - thanks for the fix earlier! I downloaded the plugin and ran it, but it had now completely stopped adding any entries. I made one small change in the source code that fixed that for me though. I changed line 183 to:

if ( $published < $date ) {

The < was the other way around first (>). I’m a bit confused regarding the logic around that…but it works for me now, even if I can’t figure out why. wink Thanks again!

 Signature 

stillburning.com | fever of fate

Profile
 
 
Posted: 05 October 2006 04:24 AM   [ Ignore ]   [ # 13 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

Thanks Sasha.

The plugin is trying to check a timestamp so that previously added entries aren’t added again, but this test is now superceded by the test on entry name and date.

I’ll remove the timestamp check completely from the next version and just rely on checking the title and date. It hits the database a little more - which is why I didn’t do it initially - but it will work better.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 06 October 2006 06:23 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

I’ve removed any attempt to check timestamp - they were too problematic. A new version of the plugin is available below:

File Attachments
pi.feedgrab.0.5.4.zip  (File Size: 21KB - Downloads: 399)
 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 06 October 2006 01:25 PM   [ Ignore ]   [ # 15 ]  
Lab Assistant
RankRank
Total Posts:  134
Joined  08-14-2004

One question: Can you run magpie at the same time? I am getting these error messages…

Fetching: feed://news.google.com/news?svnum=10&as_scoring=r&hl=en&ned=&ie=UTF-8&ned=:ePkh8BM9E8JmByvQDgNWHLYAAJLgBts&as_drrb=q&as_qdr=&as_mind=20&as_minm=1&as_maxd=19&as_maxm=1&q=design+toronto&output=atom&ned=:ePkh8BM9E8JmByvQDgNWHLYAAJLgBts

Warning: MagpieRSS: Failed to fetch feed://news.google.com/news?svnum=10&as_scoring=r&hl=en&ned=&ie=UTF-8&ned=:ePkh8BM9E8JmByvQDgNWHLYAAJLgBts&as_drrb=q&as_qdr=&as_mind=20&as_minm=1&as_maxd=19&as_maxm=1&q=design+toronto&output=atom&ned=:ePkh8BM9E8JmByvQDgNWHLYAAJLgBts. (HTTP Error: Invalid protocol “feed”) in /home/xxx/plugins/pi.feedgrab.php on line 1257

Notice: Constant RSS already defined in /home/xxx/plugins/pi.magpie.php on line 553

Notice: Constant ATOM already defined in /home/xxx/plugins/pi.magpie.php on line 554

Fatal error: Cannot redeclare class magpierss in /home/xxx/plugins/pi.magpie.php on line 557

Profile
 
 
Posted: 06 October 2006 01:50 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
RankRank
Total Posts:  134
Joined  08-14-2004

Oops, bad URL. No more error messages but it is not populating the blog for some reason.

Profile
 
 
Posted: 09 October 2006 02:32 AM   [ Ignore ]   [ # 17 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

Thanks to all of you who have sent in reports that it does not seem to be adding the entries to your weblogs.

To help me fix this I’d be very grateful if can you send me some more details so I can try and replicate the problem.

It would be useful to know:

any error messages you are getting
what version of EE you are using
the contents of template you are using to call FeedGrab
details of the weblog (eg, field names) you are trying to insert the entry into

You’re welcome to email these if you don’t want your details on the forum.

Many thanks again to everyone testing this.

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 14 November 2006 08:33 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Rank
Total Posts:  66
Joined  09-26-2006

Hi Andrew:

Terrific concept, and it’s almost there!  I’ve tried dragging the info out of my last.fm rss feed into my weblog, and I keep running into a problem in which the template will grab the first 6 entries then stop.  I’ve posted the output below:

First run with zero entries in weblog:

Fetching: http://ws.audioscrobbler.com/1.0/user/DigiFiend/recenttracks.rss
Checking: Afro Celts – Mother
Found
: Afro Celts – Mother
Checking
: Afro Celts – Anatomic
Found
: Afro Celts – Anatomic
Checking
: Afro Celts – Beautiful Rain
Found
: Afro Celts – Beautiful Rain
Checking
: Afro Celts – Sene (Working The Land)
Found: Afro Celts – Sene (Working The Land)
Checking: Afro Celts – Mojave
Found
: Afro Celts – Mojave
Checking
: Afro Celts – My Secret Bliss
Found
: Afro Celts – My Secret Bliss

Subsequent runs:

Fetching: http://ws.audioscrobbler.com/1.0/user/DigiFiend/recenttracks.rss
Checking: Afro Celts – Mother
Checking
: Afro Celts – Anatomic
Checking
: Afro Celts – Beautiful Rain
Checking
: Afro Celts – Sene (Working The Land)
Checking: Afro Celts – Mojave
Checking
: Afro Celts – My Secret Bliss

Those songs in the above listing were from approx 1 hour ago.

Deleting the entries from the weblog resets the process of successfully grabbing the first six entries and stalling.

Hope this helps!

Profile
 
 
   
1 of 11
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64905 Total Logged-in Users: 57
Total Topics: 81838 Total Anonymous Users: 37
Total Replies: 440026 Total Guests: 239
Total Posts: 521864    
Members ( View Memberlist )