GeoRSS functions
peteThomas - December 14, 2006 - 12:30
| Project: | Feedparser |
| Version: | 5.x-1.x-dev |
| Component: | feedaggregator_node |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Are there any plans afoot to provide some kind of geo referencing for aggregated RSS feeds.
--> See http://interactive.linuxjournal.com/node/8025/
--> See http://www.mapbureau.com/rdfmapper/
A task for GeoDan, based on his work with aggregator2?
http://geodaniel.org/georss-module

#1
No plans at present, mainly due to not knowing what it's for :)
#2
I 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.
#3
+1 bookmarking
#4
@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!
#5
Thanks 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.
#6
me too - i really need this feature! post a link and i'll request it as well
#7
The SimplePie Geo functions are now available as part of the $item passed in to the hook_feedapi().
#8
awesome! let me know if/when you need any testing done
#9
Excellent, I'll get onto implementing the GeoRSS module side of it tomorrow
#10
I'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).
#11
Budda, 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
#12
If 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) ?
#13
I 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).
#14
Committed to CVS
#15
Thanks Budda!
#16
#17
Please could you also patch the DRUPAL-5 branch with this update?
Many thanks!
#18
Also, which version of SimplePie is expected for the Drupal 5 release? There seems to be quite an old version in CVS at the moment...
#19
Patch 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.
#20