Closed (fixed)
Project:
Feedparser
Version:
5.x-1.x-dev
Component:
feedaggregator_node
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2006 at 12:30 UTC
Updated:
31 Jul 2007 at 16:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
buddaNo plans at present, mainly due to not knowing what it's for :)
Comment #2
geodaniel commentedI hadn't seen this post until now, but since I'm looking into adding support to the GeoRSS module to extract geodata from feeds produced by the Feedparser module, here is a good place to start.
In the past Aggregator2 module just exposed all of the feed information to other modules so that they could include it if they wish, but feedparser doesn't do this. I've tried adding in a
$node['rss_item_info'] = $item;to the feedaggregator_node_feedapi() function so other modules can access the information, but it only provides quite basic information - not all of the information from the item in the feed is added.I've got a feature request over at http://drupal.org/node/98907 for supporting other feed parsers, and Feedparser is top of my list right now, so would be keen to get this working.
I am still not sure of the best way to integrate the location-extraction from feedparser, but will continue to see if I can find a sensible way of doing it. I see the trunk version of Simplepie has get_latitude() and get_longitude() functions, which hopefully we can implement in Feedparser when the next version of Simplepie is released, and then pass that information off to the GeoRSS module to deal with it.
Comment #3
stanbroughl commented+1 bookmarking
Comment #4
budda@geodaniel
i'm still hanging on for an update to simplepie.inc so that the new object methods will be available in modules implementing the hook_feedapi() call.
I might just use a snapshot of the trunk if a new SimplePie release is not going to happen soon-ish.
Exposing all of an items data fields is something i liked about Aggregator2.module, again we're kinda tied by the data which is parsed and exposed by SimplePie here. i did put in a request for raw data to be made available in the $item object, but I guess the more people that ask for it the more likely it will happen!
Comment #5
geodaniel commentedThanks for the update, budda. I took a quick look for your request on simplepie.org for adding the raw data but couldn't see it. If you could post a link, I'll definitely add my support for it.
Comment #6
stanbroughl commentedme too - i really need this feature! post a link and i'll request it as well
Comment #7
buddaThe SimplePie Geo functions are now available as part of the $item passed in to the hook_feedapi().
Comment #8
stanbroughl commentedawesome! let me know if/when you need any testing done
Comment #9
geodaniel commentedExcellent, I'll get onto implementing the GeoRSS module side of it tomorrow
Comment #10
geodaniel commentedI've got this partially working locally, despite having found problems in each of the three feeds I am testing with (Flickr uses the wrong namespace, Geograph has a trailing slash in the namespace where there shouldn't be on and FreeThePostcode uses lat and lon instead of lat and long).
Thanks to the SimplePie updates, I'm able to pull out coordinates with ease from valid GeoRSS feeds, and now need to figure out how to save them to the node (and there's a bug in location module which is preventing that at the moment anyway I believe).
Comment #11
geodaniel commentedBudda, I think an extra hook is needed to get this to work. We could do with one in the feedaggregator_node_feedapi function that calls out to see if any other modules want to add anything to that node before it's created. That way, the basic node can be created, get the node ID, pass it out to other modules through a hook, and then have the calling function save that updated node again, if anything has been added.
(on another note, right now the whole feed array to the hook each time. Is that necessary? That's a lot of data, and it would probably only be the individual item that was needed each time)
Thanks for the help on this
Comment #12
buddaIf the Geo stuff is only going to work with the nodes processor, could you not make use of the hook_nodeapi() which is called after the basic node is generated (and thus obtaining a nid) ?
Comment #13
geodaniel commentedI can get this to work through nodeapi nice and cleanly, but we'd need to add the item data to the $node object so it can be reused (patch attached).
Comment #14
buddaCommitted to CVS
Comment #15
geodaniel commentedThanks Budda!
Comment #16
(not verified) commentedComment #17
geodaniel commentedPlease could you also patch the DRUPAL-5 branch with this update?
Many thanks!
Comment #18
geodaniel commentedAlso, which version of SimplePie is expected for the Drupal 5 release? There seems to be quite an old version in CVS at the moment...
Comment #19
buddaPatch applied to 5.x branch.
SimpleRSS is a different issue, i'm not going to upgrade that just yet -- until the module is in a general working order.
Comment #20
(not verified) commented