Geolocated blogging

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Geolocated blogging

Post by zoran »

Hi all,

I just started using s9y and I would firstly like to complement the developers on a nice piece of software! Templating, localization and plugin works great.

I came across this post (http://postneo.com/icbm/) on geoblogging. It describes how to include geo tags (latitude/longitude) to your blog. I hacked it into s9y, look for the "location" link:

http://www.kovacevic.nl/blog/archives/1 ... gging.html

Furthermore, it is also outputted in the rss feed. I feed it into worldkit (http://brainoff.com/worldkit/doc/) which renders it:

http://www.kovacevic.nl/worldkit/

I am not sure if this can be made into a plugin, any advice would be appreciated. Also, if you would like to have the code, please drop me a line.

Regards,
Zoran
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Geolocated blogging

Post by garvinhicking »

First off, thanks for your compliments and looking into all of this!

And yes, what you're doing would work quite well as a plugin. The "Creative Commons" Plugin does nearly the same, it inserts RDF metadata inside an entry as well as the RSS feed. You could use that as a base foundation - you also might want to look at the karma voting plugin, which inserts text at about the place you inserted your "Location" link.

If you then would like to share the plugin, I'd love to put it into our additional_plugins repository!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
nohn
Regular
Posts: 37
Joined: Fri Oct 08, 2004 3:28 pm

Post by nohn »

Just a question: WHich standard are you using? There is a W3C standard (http://www.w3.org/2003/01/geo/wgs84_pos), we should use for that:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<geo:Point>
<geo:lat>55.701</geo:lat>
<geo:long>12.552</geo:long>
</geo:Point>
</rdf:RDF>
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Post by zoran »

Yes, I implemented the 'older' one (icmb), I'll change it to the other one. Worldkit supports both (icmb is deprecated though).
Guest

Re: Geolocated blogging

Post by Guest »

garvinhicking wrote:And yes, what you're doing would work quite well as a plugin. The "Creative Commons" Plugin does nearly the same, it inserts RDF metadata inside an entry as well as the RSS feed. You could use that as a base foundation - you also might want to look at the karma voting plugin, which inserts text at about the place you inserted your "Location" link.

If you then would like to share the plugin, I'd love to put it into our additional_plugins repository!
I just had a look at the two examples. The geo thingy I hacked needs to add two attributes per blog entry, namely a latitude and a longitude value. In the CC example, these values are set for the whole blog, not per entry.

Is there a hook when editing or saving an item? I would then like to generate two input boxes for these values.

Or have I misunderstood your hints?

Regards,
Zoran
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

perhaps this threads needs to be moved to the 'plugins' discussion :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Geolocated blogging

Post by garvinhicking »

Hi zoran!

Ah, okay - I thought the long/lat things would refer to the blog and not to your entry.

In this case, implementing this as a plugin should best be done with Serendipity 0.8. There we added the "entryproperties" table, where you can associate each entry with specific properties.

Example plugins like 'multilingual' and 'entryproperties' already use that to store translated versions of an entry, or attributes like stickyness or reading permissions.

You could easily add a property 'latitude' and 'longitude' there. You just need to hook into the backend_display event hook, where we also already display the other mentioned plugins, or weblogping and others.

If you would need to make this funcionality to work with Serendipity 0.7, you would need to create your own table for storing the properties and fetching them in the frontend_display event hook.

So my advice is that you look at Serendipity 0.8 and the plugins serendipity_event_entryproperties (bundled) and serendipity_event_multilingual (inside 'additional_plugins' CVS repository) and then duplicate them and add a bit of functionality from the CC plugin (for RDF metadata insertion...).

If you need more help, feel free to ask!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

I understand what you're saying. It looks like the right way to go.
Unfortunately (fortunately!) I'm going on holiday for a month (I'll do some geoblogging). I I'll look into it when I get back.

Thanks for the advice!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Geolocated blogging

Post by garvinhicking »

Okay, that's cool. I hope to hear from you!

Have a nice holiday!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

Well, I finally found the time to make a first version:
- serendipity_event_geotag (allows for lat/long metadata for events, puts it in the rss2 feed, provdes a link to a mapping URL like googlemaps)
- serendipity_plugin_geotag_gmap (shows a googlemap, shows the entries on the map)

A (temporary) demo is shown here:
http://s9y.zoran.func.lindev02.func.nl/

I anybody wants to testdrive it, please download from:
http://sodemieter.nl/s9y/

Any bugs/enhancements are welcomed

Best regards,
Zoran
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Geolocated blogging

Post by garvinhicking »

Zoran,

thanks a lot! Could I commit your plugin to our additional plugins CVS?

Regards
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

garvinhicking wrote:Zoran,
thanks a lot! Could I commit your plugin to our additional plugins CVS?
Please do. Does it work for you? The entries list view for the frontend only shows the location for the first entry ...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Geolocated blogging

Post by garvinhicking »

Zoran,

actually I must admit I don't have a Google API key and didn't have time yet to test it on my own. But your code looks solid, so I see no reason to not commit your great work.

Thanks a lot,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

garvinhicking wrote:actually I must admit I don't have a Google API key and didn't have time yet to test it on my own. But your code looks solid, so I see no reason to not commit your great work.
Hehe, tnx. If you want, sign up for one here:
http://www.google.com/apis/maps/signup.html

It only takes a couple of seconds (if you have a gmail account that is).

It's also specified in the config of the plugin.

Btw: the event doesn't need a key, only the plugin.

Tnx :)
zoran
Regular
Posts: 71
Joined: Sun Jan 16, 2005 9:13 pm
Location: Amsterdam
Contact:

Re: Geolocated blogging

Post by zoran »

I just posted an update to serendipity_event_geotag:
http://sodemieter.nl/s9y/serendipity_ev ... eotag.phps

Latitude and longitude are now in the right order ;)
Post Reply