I've been using the FeedAPI in a couple sites, and have done a couple writeups about it on my blog over at OpenAcademic -- this, along with the FeedAPI, is some amazing code.
I've been looking at how delicious tags are imported -- given that delicious uses spaces and not commas to separate their terms, delicious feeds get imported as one long series of words.
How difficult would it be to set up a condition that treated feeds from delicious differently than feeds from other sources? Would this be best implemented as a helper module to the Feed Element Mapper, or as a patch to the FEMP?
If this is a patch you would want to include, let me know -- if we get some free time over the next few days/weeks, we could take a shot at this.
Cheers,
Bill
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | parser_simplepie.module_delicious.patch | 1.08 KB | SamRose |
| #6 | simplepie_delicious.inc_.tar_.gz | 870 bytes | SamRose |
Comments
Comment #1
yellek commentedSomeone already implemented this for simplepie. If someone can figure out how to include the proper inc file this could be fixed very quickly: http://simplepie.org/wiki/addons/del.icio.us.
Can someone tell me where to add the include for this file in the current feedapi module?
Comment #2
alex_b commentedHey Bill,
This issue should be solved on the FeedAPI level. The tags in (I hope I remember the location correctly) ->options->tags should be always split up correctly.
I haven't experimented with delicious feeds yet. Maybe the solution that yellek points to just works. Not knowing how exactly to include simple pie add ons, FeedAPI's parser_simplepie.module would be the place to include it in.
I would appreciate any experiences/feedback here. I will push this issue to FeedAPI.
Thanks for your help,
Alex
Comment #3
bonobo commentedHello, Alex,
I'll experiment with this a bit more, and try to isolate things down a bit -- I think it has to do with delicious tags being separated with a space, and not a comma --
At least, that's the only difference I've seen so far -- on the various test sites where I've set up the feedapi and the mapper, the only site I've had these issues with is delicious, and I've pulled in tags from a few hundred different feeds in various testing scenarios.
I'll hammer on the delicious issue in a more systematic way, and report back here.
Thanks,
Bill
Comment #4
yellek commentedI did some experimentation with this and managed to get it to work. As this is the first time I have ever written PHP please let me know if I am making beginner mistakes.
Steps required:
The complete modified function is below:
This works for me but I will leave it to more experienced PHP coders to tidy it up for inclusion in the source.
Comment #5
jgraham commentedyellek
At a quick glance this seems it would interpret all simplepie feeds as though they were delicious feeds ie. spaced instead of commas.
I think this is a very good first step but I believe it needs a bit more work on the internals so that feeds are optionally (and appropriately) interpreted in the 'delicious' format. I'm not sure what the best method for that is; right now all that is coming to mind is a whitelist by type/url, or a select choice when the user sets the feed. I think the user selectable option is better as it is more extensible, but hiding unnecessary options from users is always good too.
I'm digging to see if there is a way to appropriately detect the format on the backend and optionally include 'simplepie_delicious.inc' and call
$parser->set_item_class('SimplePie_Item_Delicious');this would avoid exposing an unnecessary option to the user.From a quick look the only obvious thing I'm seeing is the url, but that is a kludgey way to do it that would suggest a user option is much better.
Will post back as new info becomes available.
Comment #6
SamRose commentedWell, just for the heck of it, attached are patch and the simplepie_delicious.inc files to build off of
Comment #7
SamRose commentedThe funny thing is, I can't actually get this to *work*...