February 2010 Archives

Sunday, February 28, 2010, at 7:22 AM

As I mentioned, an English political blogger, one Anna Raccoon, had commissioned me to make a shiny new British version of my rusty old Autorantic Virtual Moonbat (AVM). The new robot is now built, and I am heartily sorry to introduce you to the Pet Labour Troll (PLT).

Just as with the AVM, the PLT comes in both a chat module, which lets you talk to the robot, and a smaller sidebar module, which does not.

And just as with the prior incarnation, the PLT lets anyone put either module on any website with just a line of code.

But the Pet Labour Troll also incorporates many improvements over the old AVM, using technology which was not available back in 2004. The PLT is coded in ActionScript 3 and PHP 5, making it twice as fast. And it has three things the AVM never had: its own domain, its own Facebook page, and its own Twitter feed.

The domain, labourtroll.com, has all the instructions for embedding the robot on your own website.

The Facebook page posts rants from the troll at random intervals, and the troll will reply to any posts written on its “wall.” After its first day of operation, the page has garnered 29 fans on Facebook. I expect this number to go higher.

And the Twitter page, at twitter.com/labourtroll, has its own feed of random ranting as well.

I’m sure you will join me in extending our British cousins our sincere sympathy, as they come to know the horror that is the Pet Labour Troll.

Comments on this entry:

There are 2 comments on this entry.
#1
10 Mar 2010
3:44 PM

I miss the Autorantic Virtual Moonbat, why doesn’t he get a FB page too?! I’m sure you could just replace “Bush” with “Sarah Palin” or “Glenn Beck” for the same, yet updated, deranged reactions! :)

#2
10 Mar 2010
4:03 PM

Hi Beth!

Maybe someday I’ll bring back the AVM, but for now I don’t want it to compete with the PLT. Certainly not before the UK general election.

Sunday, February 21, 2010, at 3:32 PM

Shipping the Autorantic Virtual Moonbat to Britain

Way back in 2004, I invented a humorous Flash application named the Autorantic Virtual Moonbat. It was a chatty hate-filled robot who generated random nonsensical leftist rants, such as “Chimpy McBushitler STOLE the ELECTION by outsourcing transgendered polar bears!!!” Perhaps you saw it. It wasn’t just on my blog, it was on hundreds of others as well, because I let anyone who wanted it embed it. It was very clever and funny, because it aped the style of excitable liberal writers so well.

And then, well, time passed. It still works, but I stopped updating its knowledgebase years ago. The poor dumb thing still thinks George Bush is running the world, and that global warming is a credible theory. Well, okay, so do other liberals, but my larger point is, I was pretty much done with it. And yet I still believe it can have a successful career in politics. That’s why I’m sending it to the United Kingdom.

An English political blogger contacted me, asking if the AVM could be reprogrammed as a crazy British leftist, rather than the American sort, in time for the upcoming U.K. general election in 2010. I answered in the affirmative, and so soon the device will have a new home — and a new name! — and a whole new list of enemies to hate. I will certainly keep you abreast of details as they are made final.

Comments on this entry:

There are 3 comments on this entry.
#1
25 Feb 2010
4:42 AM

Sweet! I love the shipping box.

#2
25 Feb 2010
4:47 AM

I love it!

#3
25 Feb 2010
9:55 AM

Don’t get too close, mates.

Tuesday, February 16, 2010, at 5:34 PM

Yesterday, I wrote about our new private URL shortener at u.gleeson.us. In the subsequent comments to that post, I explained more about how it works. But there are fascinating theoretical implications revolving around the whole topic. For instance, just how many URLs can this application hold before it runs out of room?

Before answering such a question, one must first define precisely what “running out of room” might mean, but as you’ll see, by any definition, the number of URLs we can shorten is… rather a lot.

Comments on this entry:

Showing only the most recent 12 comments.
See all 16 comments on this entry.
#5
16 Feb 2010
10:47 PM

I got a 500 error while posting #3, and another posting this comment the first time I tried. It’s probably just gremlins, but you might want to check Apache’s logfile and see what it had to say.

#6
16 Feb 2010
10:48 PM

Oops, I guess it worked after all. I didn’t get any error when I posted #5.

#7
16 Feb 2010
11:03 PM

You know, I was getting 500 errors myself earlier this evening when publishing template changes, then trying again and everything worked. When I checked the logs, it said something about CGI scripts missing their headers, so I suspect it was a Perl parsing thing. I think my server is having some issues tonight that have nothing to do with us. (I share it with other fine DreamHost customers, you know.)

#8
16 Feb 2010
11:06 PM

Ah, it must be Dreamhost killing off MT’s perl scripts when they run for too long, in order to preserve capability for everyone else on the server.

#9
16 Feb 2010
11:11 PM

Ironic, given that the main reason I went with MT rather than WP was to put less strain on the server.

I reckon I’ll leave the blog alone until morning, and see if it’s feeling better.

#10
16 Feb 2010
11:16 PM

Well, at least MT only gets hammered when someone doing something that causes a database write. WordPress gets hammered and falls down when people are doing nothing more than reading the page!

#11
17 Feb 2010
12:32 PM

Wow. For this comment, I didn’t sign in with my MT account, I signed in with my Facebook account! So now, anyone can sign in with a Facebook id, and bypass the CAPTCHA and everything.

I rock.

#12
17 Feb 2010
3:41 PM

Ev says he’s been trying to comment, but the reCAPTCHA isn’t working. So I’m testing it again. If you see this comment, it worked for me.

#13
17 Feb 2010
7:47 PM

Testing it out…

#14
17 Feb 2010
7:48 PM

Yay!

#15
17 Feb 2010
8:15 PM

Sean, Trying to make contact with you, can’t find a working e-mail address! Could you respond please?

#16
17 Feb 2010
9:01 PM

Sorry, Anna. I still haven’t finished building all the pages on this site. There will definitely be a full complement of contact information soon. You may email me at sean@gleeson.us

Monday, February 15, 2010, at 5:45 PM

This morning, Phoebe and I were talking about stuff, as we are wont to do from time to time, and the topic of URL shortening came up. You know, those services like tinyurl.com and bit.ly that take a really long URL and convert it to a much shorter one. It’s handy for pasting URLs into emails, or tweets, or other spaces where an overly long URL doesn’t fit.

On the other hand, these services do have their drawbacks. For one thing, they are not guaranteed to be permanent; if they go out of business, your links might die along with them. For another, they are used so often by spammers for sneaky redirects that users might be wary of clicking on one of their generated links. Some websites even ban all tinyurl links from their sites, and with good reason.

But, we realized, these problems wouldn’t exist if we had our own URL shortener! And so today I built us one. We now have u.gleeson.us, a URL shortener that we own, and that only Phoebe and I can use. So now I can take really horribly long URLs like this…

http://www.amazon.com/gp/product/1596062266?ie=UTF8
&tag=gleesonus-20&linkCode=as2&camp=1789
&creative=390957&creativeASIN=1596062266

..and instantly convert them to short ones, like this…

u.gleeson.us/6

By the way, that link — both of them, really — goes to an excellent anthology by Jack Vance, one of my all-time favorite authors. Just in case you were curious, but not curious enough to click.

Comments on this entry:

There are 10 comments on this entry.
#1
15 Feb 2010
6:42 PM

Cool! Care to give us any clues as to how you did it? (Appending redirects to an .htaccess file, perhaps?)

#2
15 Feb 2010
6:54 PM

You guessed it! Here is my .htaccess file in its entirety:

RewriteEngine on
RewriteRule ^.+\..+$ - [L]
RewriteRule ^(.+)$ elongate.php?b=$1 [L]

The first RewriteRule just says to let any requests that include a period to pass through unchanged. That way I can still put normal files on that domain, because all filenames have periods. At least, they should.

All other requests go to the second RewriteRule, which invisibly loads a PHP script and passes the request in a query string.

The PHP script, of course, just converts the request (which is in a base-52 numbering system to make it extra short) to an integer, and looks up the URL with that index.

#3
16 Feb 2010
10:48 AM

Wow, how the heck does base 52 work? Are you using non-alphanumerics past 36?

#4
16 Feb 2010
12:19 PM

Upper and lowercase letters, dude. (The URL shortener tr.im uses a base-62 system with A-Z, a-z, and 0-9. So mine is 10 less.)

Here are the glyphs I use:

A-Z, except vowels -- 21 chars
a-z, except vowels -- 21 chars
2-9 -- 8 chars
hyphen and underscore -- 2 chars

That adds up to 52. I left out the vowels (and zero and one, because they can look like O and I) so that my encoded URLs will never inadvertently spell any offensive words in any language. It would be awkward, for instance, if I emailed my dad a link and it was u.gleeson.us/TitS wouldn’t it?

#5
16 Feb 2010
12:53 PM

Aha! Very clever, and it’s good design to avoid the ambiguity of 0 and O, l and 1.

I tried to figure out what you were doing by subtracting 36 from 52, but that’s 16, and I couldn’t figure out what the heck you were using sixteen of.

my encoded URLs will never inadvertently spell any offensive words in any language

You must not speak Klingon.

#6
16 Feb 2010
1:11 PM
You must not speak Klingon.

That’s a pretty good maxim for humans in general.

But come to think of it, Hebrew has no vowels, either, right? Maybe I should have left out the consonants instead.

#7
16 Feb 2010
1:17 PM

LOL.

I have a hard time reading your captcha, by the way. The black text on grainy grey background can be hard to parse. Have you considered recaptcha? It’s easier for humans to solve because words are easier to read than random unpronounceable strings (I’m solving a “zhsust” right now), there’s an MT plugin for it, and it’s even a good cause: people solving your captcha are actually helping to digitize books!

#8
16 Feb 2010
1:30 PM

Well, it’s hardly my fault if you don’t know what a zhsust is. But I do take your larger point. I will use recaptcha instead at my earliest opportunity.

#9
16 Feb 2010
10:24 PM

This is me, Sean Gleeson, but I am not signed in, so I can comment anonymously and test my new reCAPTCHA thingie. If you are seeing this comment on my site, then that means it worked.

#10
16 Feb 2010
10:37 PM

This is awesome, it’s working great!

Sunday, February 14, 2010, at 2:01 PM

I’ve got some extra-fancy code serving ads on this blog. Which ads you see on the page depend on how you got to the page. If you arrived here from a major search engine (e.g., Google, Yahoo, Bing) in the United States or Canada, you are seeing ads by Chitika. (I keep wanting to call them “Chikita,” like chiquita, but it’s Chitika.)

Chitika is pretty neat; their ads only show up for search-engine-referred traffic, and not for any other traffic. So, for instance, someone who got here via a Google search for “celebrity lingerie” would see some Chitika ads all about celebrity lingerie. But the folks who just came here because they like the blog, or followed a link from somewhere else, will never see any Chitika ads at all. I like that.

For all the pageloads that don’t get the Chitika treatment, I’ve got a Google AdSense ad in the sidebar. The last time I used AdSense was quite a few years ago, so I thought surely it must be vastly improved by now: better controls and filters, easier interface. But no, it’s pretty much how I remembered it.

I do like how AdSense text ads can be customized to blend tastefully with my site’s design, but I wish there were some better ways to control which ads I will allow. (Yes, I can block ads from any URL I don’t like, but wouldn’t it be so much better to block ads for products or services I don’t want to advertise?)

And finally, for those occasions when AdSense doesn’t have any relevant ads to display, I fill the sidebar spot with my own house ads, such as for games I have made, or websites I like. These won’t show very often, so I’ll show you a couple now. These two are for games I made:

Dashabooja -- it's like poker, but with ten hands. Wichita Faro -- The authentic card game of the Old West.

And these three are for games by my bestest friends at Pixelatrix Games:

Haven -- Solve the mystery of the haunted asylum. House -- You can get in, but can you get out? Shipwrecked -- An adventure in the jungle.


Topic:
Permalink No comments yet Add your comment
Saturday, February 13, 2010, at 9:51 PM

Over the past week, I have been learning how to write a Facebook application, so I could make our blogs post links on Facebook automatically every time we write a new entry. I noticed that there were services that did this already (such as Networked Blogs and Ping.fm), but none of the ones I found did exactly what I wanted, so I wrote my own. That’s just how I roll.

I had to read a lot of the Facebook Developers Documentation to get their API specs, especially the FBML language reference.

I’ve tested the code, and it works, but I haven’t actually gone live with the actual automatic posting yet. That will happen tomorrow.

UPDATE: Yep, totally works. Now I can do other stuff.


Topic: ,
Permalink No comments yet Add your comment
Saturday, February 6, 2010, at 9:51 AM

Today, being the first Saturday of February, is Ice Cream for Breakfast Day. (I couldn’t find some official I.C.f.B.D. site to link to, so this is a link to a Google search.) *

I have three quarts of Breyer’s Neapolitan for the kids, and a pint of Starbuck’s coffee ice cream for me and Phoebe.

*UPDATE: Phoebe tells me that the itzahckret page really is the “official” I.C.f.B.D. site. So, now we know.

Comments on this entry:

There is 1 comment on this entry.
#1
15 Feb 2010
6:18 PM

Ir must be genetic on the Palumbo side! We used to do the same thing when my kids were little…

Wednesday, February 3, 2010, at 9:32 AM

Yesterday, in addition to making my PHP workaround, I also wrote a Movable Type plugin I call “True Comment Number.” If you look at an entry on this blog that has comments, you’ll notice that I number them, starting with “1” for the first comment, and going up from there. This numbering was not working properly with paginated comments, so that’s why I wrote True Comment Number.

Anyone who wants my plugin may download TrueCommentNumber.zip and use it.


Topic: ,
Permalink No comments yet Add your comment
Tuesday, February 2, 2010, at 6:56 PM

I just fixed a couple more Movable Type things. I reckon I must have the only working copy of MT5 in the whole world. Today I did a number of fixes to the new-fangled comment pagination feature.

Comment pagination is pretty cool. We’ve all been to blog pages with hundreds and hundreds of comments, and seen how such a huge page can clobber your browser. But the Movable Type comment pagination lets you only show a limited number of the most recent comments on your page, then uses AJAX to navigate to newer or older comments, without reloading the whole page.

The only problem was, it didn’t work. There were two or three problems I had to track down and fix. First of all, my blog (at seangleeson.com) is on a different domain from my MT installation (at mt5.gleeson.us). But the comment pagination script relies on an XMLHttpRequest, and as we all know, cross-domain XMLHttpRequests are illegal! The blog page was requesting a batch of comments from mt5.gleeson.us/mt-comments.cgi, and getting denied.

I fixed this problem by putting a very simple PHP script at seangleeson.com/commentlisting.php. All this script does is act as a go-between, a middleman. It gets the request from the blog page, passes it along to the MT script, gets an answer from the MT script, and passes it back to the blog page. So now the blog has a legal place to send its XMLHttpRequest.


Topic: ,
Permalink No comments yet Add your comment
(Thanks for reading all the way to the bottom.)

Sean Gleeson is an artist, developer, writer, teacher, statesman, and family man in Oklahoma City, Oklahoma.

See full profile.

Sean Gleeson Sean Gleeson