Recent Entries in Movable Type

You may notice that I put a Google Map into my previous post for the Green Mill in downtown Chicago. I didn't make use of the MTGoogleMaps plugin (I think). Here's how I did it:


  1. Used http://www.geocoder.us to translate the address into map coordinates
  2. Set the "Text Formatting" drop-down list to "None"
  3. Used HTML tags to properly format the rest of the entry
  4. Inserted the following code with my API key into the "Entry Body" field

googlemaps_code_movable_type.jpg

As you can see, pretty easy, aside from the code. This stuff normally goes into the header and template of the Movable Type index page, and the MTGoogleMaps plugin takes care of translating the address to the proper map coordinates. The way I've done it allows you to insert a static map without all that fancy template coding, or using a MT plugin to translate MT tags in an entry. Just straightforward GoogleMaps code.

I had a few minutes of lag time, while waiting for my workstation to reboot and purge itself of virii and adware, so I tinkered for a little bit on a spare laptop. I finally got this Google Maps thing to work, using some tips from the MTGoogleMaps plugin creator, Nick Punter. Apparently, when using MTGoogleMaps and Canadian addresses, the plugin goes to the Geocoder.ca service. For this to work, you've got to insert commas between each part of the address. So instead of "123 Foobar St., Toronto, ON", you've got to use something like "123, Foobar St., Toronto, ON".

Once I confirmed that the plugin worked, I tried to do something a little more creative, like configuring it so that it would only show a Google Map in my MT blog if I wanted it there. I mean, how useless is it to render a static Google Map in your dynamically generated Main Index template? You end up with a fixed map in every single entry on your main page. What if you want a different Google Map for every blog entry? What if you don't want to display a Google Map in all of your entries? How about having a map display only when a certain field is filled in?

Well, it's a little more difficult than it looks. Here's why: Say I wanted to use the <MTEntryIfExtended> tag, so that the map would only show up in the "ExtendedEntry" section if some text were placed in the "ExtendedEntry" section -- say, a map address. That's great, but when it renders, the map code will render in the section along with the address from which the map is rendered, making a loop, and making a failure out of me. Luckily the plugin is smart enough not to render the map.

The trick is, then, to put the rendering address in another section, such as in the "EntryExcerpt" field, which I don't normally use. That way, the map address and info can be pulled from the same section, if I insert text into the "ExtendedEntry" field. Here's how the Main Index template looks:

google_maps_code.jpg

Here's how the entry looks:

google_maps_entry.jpg

And finally, here's how it rendered:

google_maps_successful.jpg

Pretty neat. Of course, this only works on the front page of the blog. If you click on the permalink, the Google Map doesn't render, and you get "ggggg" instead.

Don't know if I'm going to put this into the main blog just yet. Doing this pretty much locks both the "ExtendedEntry" and the "EntryExcerpt" fields into the MTGoogleMaps mechanism. If I ever start up a travel blog, it'd be useful there.

This test is the same as the previous one, but with a Canadian address. I've picked the Huether Hotel, in Waterloo (59 King Street North, Waterloo, Ontario).

Update: Awww. No dice. I'm beginning to think there's still a problem with Geocoder... I'll have to look into it some more.

failed_google_map_placeholder.jpg

This time I'm using v2.0. I've setup the main page template to put a static Google Map into the page if something's placed in the Extended Entry Field.

Update: OK, that worked fine. Kudos to Nick for putting out the little fixes. This map was generated with the following code:

<MTEntryIfExtended>
  <MTGoogleMaps address="123 Main St. New York, NY 10001" info="About this address" width="400px" height="300px" zoom="4"></MTGoogleMaps>
  <p class="entry-more-link">
  <a href="<$MTEntryPermalink$>#more">Continue reading "<$MTEntryTitle$>" »</a>
  </p>
</MTEntryIfExtended>

MTGoogleMap_success.jpg

Thought I'd try some more GoogleMaps tests, in anticipation of the new release of MTGoogleMaps 2 (with support for us Canadian bloggers). If this works, you should see an inserted Google map. You probably won't see it, knowing my luck...

failed_google_map_placeholder.jpg

google_maps_test.jpg

Well, I couldn't really get this to work. Oh, it worked fine if all the circumstances were right, but for what I wanted it to do, the plugin's not yet ready. After running a few tests with the MTGoogleMaps plugin, I've determined two main problems.

The first problem is with getting the plugin code to render properly when some text (such as an address) is inserted somewhere in the blog post. My thinking is that if I want to show a map, I'll put in an address, and a map will render somewhere in the posting. If I don't put an address in, there is no map (and there is no big blank space where a map would render). So I was trying to find a way to place it within the <MTEntryIfExtended> tags. The problem is getting around the Catch-22 of Movable Type -- that the <MTEntryIfExtended> tag relies on the existence on the <MTEntryMore> string, which only exists if something is placed in the extended entry field. The MTGoogleMaps plugin dynamically looks in a field (i.e. in the extended field) for an address, so it would be using the contents of the <MTEntryMore> to help it render the map. At one point, all my posts were trying to render a map, but only one had anything that could be dynamically generated by the plugin.

If I don't put anything in the extended field, then no problem.

So I tried hardcoding the address into the MTGoogleMaps code, and using "foo" in the extended entry field. This worked fine for a quick functionality test, and I figured I could work out the details later, as long as the plugin worked as expected.

Which brings me to the second big problem in functionality, and it was a little bit of a problem with the MTGoogleMaps code, and more than a little to do with the way it translates addresses into coordinates. MTGoogleMaps uses Geocoder.us to translate the addresses into map coordinates. It does this via an RPC post to Geocoder's website, but their database is a little sketchy, and doesn't have many large American cities in it. For example, the sample address provided with the MTGoogleMaps works fine:

http://rpc.geocoder.us/service/rest?address=123 Main St. New York, NY 10001

But it won't render any Canadian addresses -- making the whole thing useless for us bloggers north of the border. In fact, instead of a map, I get a big blank spot on my page, and this showing up in my page source:

...
map.centerAndZoom(new GPoint(/var/www/htdocs/blogzucker/index.html, ), 4);
...

Canadian cities are one thing, but it needs to be able to at least render US cities properly. Sure, Main St. New York is fine, but some addresses in San Francisco won't render any better than Canadian ones. I just get a "couldn't find this address! sorry" message from the Geocoder.us website.

Which is where the MTGoogleMaps code is hitting a wall. It's not responding very gracefully to the literal text string of "couldn't find this address! sorry".

I thought for a second that I might be able to use Geocoder.ca instead, but it uses an entirely different syntax in its API, and doesn't even return a string value when you send a call -- you just get their main page with the address form pre-populated. The other geocoding sites all use their own syntax, so unless I'm going to rewrite the way the plugin parses responses and sends queries, I can call it quits for now.

I sent my feedback to Nick, the plugin's author, and he's adding in some simple error checking that will catch any "couldn't find this address! sorry" errors from Geocoder.us. He's also going to check out some international geocoding searches, but I don't expect Canada to be on the top of anyone's list.

It will be neat if I can get this to work with my main blog. My plan was to put maps in whenever I'm posting from away, sort of a travel blog with maps.

Figured I'd follow the trend in making the site a little more grown up (this despite having a blog with weird links in it). I also worked a bit on integrating the scode security stuff into the comment posting mechanism. Kinda flakey, it was. Now it should be a bit better.

new_missinglinks_layout.jpg

It's still not quite yet where I want it to be, and I still have to do all my static pages (which look crazy with the new stylesheet in place -- yikes!!). The whole thing will be a little while yet.

  Upgrade to MT 3.2

I figured it was time to take the plunge. I bought MovableType 3.2, and got it installed on my webserver. I kind of feels nice to be using software that I paid for (or, more specifically, it feels nice to finally have software worth buying). I buy software all the time, but I never quite feel that it's worth the money being paid (read: Win-dows). The new MT also has a better integration with most of the new plugins available, and it's more robust with respect to stylesheets, et cetera. I'm currently looking at this Google Maps plugin for MT, known as MTGoogleMaps, or something equally descriptive. I'll be testing it over the next little while, and see if I can come up with a way to make it work with my blog.

This upgrade is also a good excuse to get me to fix some of the bad stylesheet stuff on my site, and to update its look a bit. Rounded corners are all the rage, these days.

  Anti-Spam Measures

In my growing disdain of comment and trackback spam, I've taken further measures against it. I've located and installed some great anti-comment spam and anti-trackback spam plugins from this really cool James Seng guy. Now, you can't post comments without copying a security code from an image to a form field (you may have seen this on better websites than mine). I was going to install a plugin that utilized fuzzy logic to determine what trackback pings were spam -- a learning plugin, which would adapt over time. But I'm a very lazy man. How lazy? Don't get me started....

security_code.jpg

Hopefully this will help in the fight against the dark side.

  Moblog results

Not bad, not bad. Didn't post right away, but I just need to tweak my crontab syntax a little -- move a pair of quotes around.

Wow, that was a little easier than I thought it would be. Neat. Now I don't really need the Netbook (although it's a little easier to type with).

This means I'm now a fully functional MoBlogger. Again, neat. I suppose now I need the ability to take pictures and upload them too. Well, one step at a time.

  Moblog test

Blogging from Jane Bond tonight. C+J are here with me, and R's showing up as well, though she probably won't order anything, since everything's so damned expensive.

So, let's see if this thing posts or not ...

I think I may have found what I'm looking for. I'm trying to find ways to post a deferred post, since my Blackberry cannot post immediately (à la auto-reload). This little perl script may be just the right little doo-dad I need. It's called MovableTypeTrickle and I'll just have to test it out.

  Blogberry

So, I've determined there are some problems with using the Blackberry to blog. No, I'm not currently blogging from it. I was using it earlier at 1842, while drinking an espresso. Unfortunately, I accidentally hit the back button (which is conveniently a Function+Del key combination), and I lost the three paragraphs I typed. Also, apparently, the scripts in my Movable Type don't seem to work on the Blackberry browser, or it doesn't support auto-reload of pages, which is required (apparently) to post and publish an entry. I can set the entry to "publish" later, from a different machine, but not from a Blackberry.

I'm currently looking into ways of getting around this problem, possibly by configuring a post-by-email option, or a simple submission form that supports WAP browsers. There may also be something in the MT forums, or possibly some kind of plug-in. I've just been too lazy to get out there and solve the problem.

  RSS Problems fixed?

Had a bit of a problem with my rss feed after moving my blog from one folder to another. Also worried I've wrecked some links on other people's websites (although I'm kind of kidding myself, thinking that other people read this blog -- heh). I found an interim solution to the rss feed by running a little cron job which copies the existing .xml file from one folder to another every half hour. The updates may not appear to by synchronous, but I'm sure no one even reads, let alone checks every half hour. I'll notice the difference since I'm subscribed to both feeds through BlogLines but that's just me.

So this post is sort of a little test to see if my new template takes care of the time offsets in my posts, and if my cron job updates both feeds.

[april_28_05.jpg]

  Pretty Nice Weekend

It's a beautiful day today, and I'm sitting out on the deck in the shade, drinking a cup of coffee. R's soaking up the sun in one of those fold-up camping chairs we picked up in Algonquin last year. One of the cats is outside on a leash -- China's been surprisingly adventurous today. She's much less afraid than she usually is.

I took some nice pictures of the yard today, and I'll see if I can get them online in a little while. I'm working from the Netbook Pro today, so no image editing software or standard-sized USB port (note to self - if there's a compact flash to memory stick adapter, I should look into it).

Went to Starlight last night --this is getting to be part of the weekly routine, it seems. Slightly different crowd than is usually there. The hipsters are disappearing, and are being replaced with jocks, fratboys, and loud, annoying chix. Three of the latter pushed past me in the bar lineup, and elbowed me in the ribs, trying to clear some space for themselves. Then one of them started bitching at me for getting served before she did. What can I say? I'm a regular now -- also, I was here first....

Did some minor blog modifications last night. I thought it might be neater to keep the blog in a subfolder, instead of leaving it integrated as part of the main site. The benefits of this are that everything's nicely modular, like the Missinglinks page, and it might get treated like a separate blog on some of the ping sites. It was pretty easy to do, since MovableType allows you to export entries and import them at the click of a button (and the creation of an import/ folder in the mt/ directory, but I digress...).

Also fixed a problem with not being able to post comments on the Missinglinks page. Someone emailed me and pointed it out. Apparently, in my zeal to stop comment spamming on MT, I added a blank entry to my banned IP list, effectively banning everyone. It took me a little while to figure this out, and I spent many minutes perusing the MT scripts to figure out where this "You are not allowed to post comments" error message was coming from. So that's fixed now. And here I was wondering why I wasn't getting spammed for the past month.

  Funny Blog Log

Checked the blog log this morning. It's something I do occasionally to keep an eye on comment spammers. Funny thing though, it also shows me what people are searching for on my site. Typically, it's something to do with this one posting on Red vs Blue or this other single posting I did on Habbo Hotel. Occasionally, I get something pretty weird and/or funny. Here's what showed up this morning:


  • Search: query for 'long toenails'
  • Search: query for 'long toenails'
  • Search: query for 'initiation'
  • Search: query for 'spanking'
  • Search: query for 'RvB'
  • Search: query for 'redvsblue'
  • Search: query for 'Grif'
  • Search: query for 'Halo'
  • Search: query for 'RVS'
  • Search: query for 'RVB'
  • Search: query for 'Tex'
  • Search: query for 'Caboose'

For those who never look around my site -- not that there's anything wrong with that (I barely scratch the surface, myself) -- I got those SpamRock pics up. Also did some fixes to make the site more up-to-date. Stuff like getting most of the pages to at least have the updated stylesheets and theme colours (!!!). I've been looking for a more efficient way of doing this for the static pages, but haven't had much luck. Going to revamp the art pages -- maybe with some real artwork -- so they're offline right now.

[lenin_blog.jpg]

Ok, blog is back online now, and barring some minor stylesheet issues, and static pages which need to be redone, the thing's back in working order. So for those of you keeping articles around for the MissingLinks page, you should be able to login now and get back to work!

  Blog just about done

Just a few more stylesheet issues here and there, and we'll be all set. I still need to get at those static pages of mine, and finally post some images in the gallery.
(also, I wanted to have at least one entry in the month of September).

  New Blog Soon

Been a little busy with work and stuff. I'm getting close to switching over the whole blog to 2.64 (because I don't want to pay for v3), and there are quite a few decent plugins available now. I'm having trouble picking a few out. Most useful is this plugin which will prevent users from spamming my comments sections with penis enlargement ads. Not that the world doesn't need a larger penis, but it's really wreaking havoc on my tiny little Berkeley DB.

The new blog's got mySQL running, and some of the latest stuff available for OpenBSD 3.4 (I'm upgrading that to 3.5 as well). All my test stuff is stuck up on www.zuckervati.com:81/test for now.

  More Updated

OK, now all the Missinglinks pages are updated, and have passed my rudimentary QA tests. Curse me for using Source Integrity! All those bugs and customer calls I had to put up with are now coming back to haunt me as a user....


Still need to get the static pages into the new style, and that shouldn't take too long. Just to find time now to get those setup. Then I can tear it all down again, as I upgrade OpenBSD, Apache, Movable Type, get mySQL on there, and maybe a couple of fun PHP script things.


(sigh)

  Partly updated

So I've done some updating of the site, at least the main blog pags and some of the navigation images. I've still got to retrofit the other pages, but that shouldn't take too long (maybe I can post some pics finally). I still have to get the Missing Links page reformatted, but I've got a couple of cool ideas for that. Once that's all done, I'll get the new server up and running, then switch the entire load over to it.


My eventual goal is to get the Radio Zuckervati station back online, and get the ability to post updates via email. Eventually....


Mailing List Signup

What? There's a mailing list? Sign up for the Mailing List

About Me

I suppose if you've been reading my site for any length of time, you're probably curious to know who I am, and why I think people will read my blog. Online, I'm known as Zuckervati, mostly because it's easy...
» More ...

Follow Me on Twitter


Recent Entries

  • Using Boilerplates in Movable Type

    For those of you using Movable Type as your blogging platform, there's an interesting, and rarely talked about feature called Boilerplates in version 5+. In...

  • How To Get Traffic To Your Blog

    I could have just tweeted this post from Writer's Life.org, but that wouldn't have brought anyone to my blog. Ah, I kid. But, there's some...

  • Turning Fifteen

    A test entry. It's been a while since I've posted anything. Can you blame me? This blog's been going on for fifteen years. Whoa, has...

  • Merging Blogs

    Taking all my Zuckervati blogs and merging them up in the dot-com domain. Hopefully, this will make it a bit easier for me and for...

  • Test Entry for New Blog

    Here is some text... Working on merging the various blogs together into one mega-blog with an easy URL. Here's a picture: Here's some text in...

Tag Cloud

politik / film / video / skeptic / cewl / techno / humour / haxors / nosh / can-con / gaming / religion / weird / sex / funny / eco / music / stupid / photos / cocktails / George Bush / blogosphere / flickr / travel / evolution / politics / creationism / creationist / mobile / awful / photography / Star Wars / awesome / geek / bartending / coffee / drinking / mixology / alcohol / liquor / bartender / cocktail recipe / cats / food / Savoy Cocktail Book / science / Lovecraft / parody / books / Cthulhu / articles / TV / pets / John McCain / Movable Type / promos / cartoons / sci-fi / Canada / Radio Zuckervati / cool / Roger Ebert / system / atheism / comics / reviews / technology / zombies / anime / anonymous / MMO / Star Trek / television / writing / Alinea / animation / Batman / Futurama / Halloween / horror

Twitter Stream

D H McKee's bookshelf: to-read

Sunset and Sawdust
tagged: to-read
The Thicket
tagged: to-read
Hyenas
tagged: to-read

goodreads.com


Close