Geotagging posts in BlogEngine.NET

Updated on Sunday, September 30, 2018

Geotagging posts in BlogEngine.NET

I've written an extension for BlogEngine.NET that automatically adds several different geographical tags to blog posts. I knocked this up for my Hikes blog. It might be useful for any blog where some of the posts are related to a real world location.

To get started download GeotagFromKML.zip (2.24 kb) and copy GeotagFromKML.cs to the App_Code\Extensions folder in your BlogEngine.NET instance.

The extension does two things. Firstly it looks for a link to a KML file when post is added or updated (it does this because each of my hike posts includes a Google Earth KML file for the hike). If a KML link is found then a paragraph is added to the post containing the longitude and latitude of the first coordinate in the KML file. The paragraph uses the Geo microformat. You can customize the text in settings for the extension. You can also regenerate by deleting the paragraph and saving the post. 

The second function is to add ICBM and Geo Tag META tags when serving a post that contains the geotagged coordinates. You can take advantage of this without linking to a KML file, just include a location like this in your post:

Once you have geotagging up and running you might also want to add GeoURL to the list of ping services for your site.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

(Published to the Fediverse as: Geotagging posts in BlogEngine.NET #code #blogengine.net #.net #c# #metadata #kml #geo #icbm #geourl #geotag A customer extension that supports geotagging posts in BlogEngine.NET. )

Top 5 reasons to hate the Facebook like button

Updated on Thursday, November 12, 2015

5. Validation

The metadata required to use the like button looks like this:

[code:html]





[/code]

But the property attribute isn't valid html or xhtml. The “Open” Graph Protocol says that it's inspired by Dublin Core. DC manages to get by using the name attribute like any other meta tag - why can't Open Graph? It's not the worst problem but it just seems needlessly irksome. Facebook has published a presentation describing their design decisions. This would be great, but it's in that Lessig one word per slide style and so it's attractive but completely useless without the presenter.

4. Fragility

Facebook's documentation is frustratingly sparse. For example you need to specify the owner of the page using a Facebook ID, and once you've chosen a name for your profile this is hard to find. The information vacuum has been filled with many erroneous blog posts saying to use the name, or some number from a shared photo (the best source is http://graph.facebook.com/robert.ellison, substituting your own username). Once you've got the admin ID wrong, you can't correct it - the first admin specified is fixed forever. What happens if a site is hacked and a bad actor sets themselves up as the admin? Surely something like the Google Webmaster Tools authentication scheme could have been used instead?

3. Pages with more than one object

Describing the object being liked in the head element limits you to one object per page. For some sites this is perfect, but what about a blog where you have many posts on the home page? It would be useful to have a like button per post, pointing at the permalink for the post in question. I've worked around this by having a like button for the blog on the home page, and a like button for each post on the post pages. Not ideal. I'm using the iframe version of the gadget, possibly there's some more flexibility with the XBML variant.

2. Duplicating existing pages

Let's say you've spent the past couple of years building up a Facebook page for your site/band/blog/movie and have thousands of fans. When you click your new like button for the first time you create a whole new page. There's no way to tell the like button about the existing page or the existing page about the like button. You now have at least two pages to worry about managing and potentially many, many more. You're also starting from scratch on the ‘like’ count, so even if your brand is already popular on Facebook it's back to Billy no-mates for you.

I can't believe this won't be fixed at some point. As with admin authentication above there must be a better way to establish ownership of various objects in the social graph.

1. Vocabulary

Doctors defend genital nick for girls

For better or worse Facebook has the inexorable pull to start making the semantic web a reality. Given this, and that there are something like twenty-four thousand verbs in the English language it's time for more expressiveness than ‘like’. You also can't comment on the ‘liked’ item in your stream (yet) so no clarification or discussion is possible.

--

Having said all that, if you enjoyed this post please click the ‘like’ button above ;)

Add your comment...

Related Posts

You Might Also Like

(All Etc Posts)

(Published to the Fediverse as: Top 5 reasons to hate the Facebook like button #etc #facebook #like #lessig #dublincore #semanticweb #opengraph #metadata Why can't you link to an existing page? How can you have a like button per blog post on your home page? Are we headed towards a world with only one verb? )