Wednesday, August 27, 2008

"Hacking" Blogger's Profile Search, Part II

Last week I wrote about how Blogger's Profile Search feature allows users to locate Bloggers in other countries, and how you can tweak the URL parameters to find people without even knowing a single blog in your country of interest as a starting point. The process is simple and workable-- just view source on your "Edit Profile" screen to learn the two letter country code of the country you are interested in (example: VA for Vatican), and then append that code to the search URL, like so:

http://www.blogger.com/profile-find.g?t=l&loc0=VA

Not bad, but who wants to "View Source" every time they want to look up a new country? Besides, some of our friends and family members (who aren't necessarily web developers) might want to also play along-- and this solution isn't user friendly for non-geeks. They're bound to mess up the URL somehow.

How about a web form that lets users select a country from a drop-down list of all the countries? And, instead of manually modifying a URL, all they have to do is hit the "Submit" button?

This turns out to be surprisingly easy-- it just requires a little HTML.

Blogger Profile Search Interface

Show me all Bloggers in:




Let's take it apart and see how it works. We start with a basic form tag:

<form action="http://www.blogger.com/profile-find.g" method="get">
. . . we'll flesh out this bit later on . . .
<form>

The action attribute above, which tells the form where it should send its information when the submit button is pressed, is pointing at the same URL we used last time for Blogger's profile search-- except there don't seem to be any parameters tacked on to the end of the URL. Don't worry, we'll be teaching our form how to add that extra stuff to the end of the URL "behind the scenes." We will do that by using the form's "get" method.

Before we go any further with our form, let's take a second look at that example URL from before:

http://www.blogger.com/profile-find.g?t=l&loc0=VA

See that "t=l" bit in the middle there that I've bolded for emphasis? Blogger's Profile Search feature can actually find Bloggers in many different ways: by location, by occupation, by interest, favorite book titles, etc. That "t=l" business lets Blogger's Profile Search program know that you are interested in carrying out a search by location. For you mnemonic learners out there, that's t (as in type) equals l (as in location).

We need to make sure our form passes that "t=l" parameter to the Blogger URL before passing the country code. We also want to make sure it can't be changed/messed up by our non-web geek friends. The best way to accomplish both goals is to put a hidden field in the form, like so:

<form action="http://www.blogger.com/profile-find.g" method="get">
<input name="t" value="l" type="hidden">
. . . the drop down list of countries will eventually go here . . .
<form>

Now that we know our form will always specify the "search by location" type of query, we can focus on the "heavy lifting" part-- namely listing all the countries in a drop down list. The important bit to remember is to name the select tag with the same parameter label (i.e. loc0) the Blogger search URL is expecting. If I were to name it something like "countryList" it won't work.

<form action="http://www.blogger.com/profile-find.g" method="get">
<input name="t" value="l" type="hidden">
<select name="loc0" id="loc0" style="font-family:Verdana, sans-serif;">
<option value="_nil_">Select a country</option>
<option value="AF">Afghanistan</option>
. . . I'm not going to type in the entire country list, just enough to convey the idea . . .
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select>
. . .
<form>

I'll leave the specific text content and styling of the form (e.g. background color, font, border, etc.) to your personal tastes. That leaves us with the actual submit button:

<form action="http://www.blogger.com/profile-find.g" method="get">
<input name="t" value="l" type="hidden">
<select name="loc0" id="loc0" style="font-family:Verdana, sans-serif;">
<option value="_nil_">Select a country</option>
<option value="AF">Afghanistan</option>
. . . I'm not going to type in the entire country list, just enough to convey the idea . . .
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select>
<input type="Submit" value="Submit" / >
<form>

Monday, August 25, 2008

Platewire.com

Driving home from work today, an aggressive driver in a light tan Sienna (VA tags JDE-2781) nearly forced me off the road and into a ditch. I considered reporting this to the police, but past experiences have led me to believe this is a waste of time.

So-- I figured, why don't I publish the jerk's license plate on the Internet, along with a description of his vehicle? Then, as I thought about it more, I realized it would be even better if I could create some kind of web-based application that people could use to "report" dangerous and/or aggressive drivers. Not "report" as in "turn over to the authorities," but "report" as in publicly shame a la "The Scarlet Letter."

Turns out I'm not the only person thinking along these lines-- and someone already beat me to the punch. I'm talking about platewire.com, the site which allows you to post notices (good or bad) about specific license plates. It's an intriguing concept, and has a surprising number of features. You have to create an account with a valid email address, which is a good way to reduce the potential for abuse/slander/libel.

Now, if you'll excuse me, I need to create an account so I can give a BIG RED FLAG to Mr. Tan Sienna Van Man.

Wednesday, August 20, 2008

"Hacking" Blogger's Profile Search

Suppose you want to find all Blogger users that live in Vatican.

You could try a Google Search for the terms "Vatican" and "Blogger." Those results would include any webpage that contained those two terms in it (regardless of whether the author lives in Vatican or is just writing about Vatican or Vatican City), but you could poke around until you got lucky and found a Blogger who actually lived in Vatican. From there, you could read their profile and use their location link to find all the other bloggers who identify themselves as living within Vatican. It might take a while, but you could do it.

Or, you could analyze Blogger's Profile Search URL and figure out it's being used to pass search parameters. Once you understand the logic behind the URL, you could then quickly build your own custom URLs to find Bloggers in Vatican or any country you desire.

The first and most important lesson in "hacking" (in the old-school sense of the word, not in the "breaking into systems/stealing/vandalizing" sense that the media likes to perpetuate these days) is to be observant and figure out the underlying nature of how things work.

Take the typical Profile Search URL from Blogger, for example. When I click on my profile, and then click on the "United States" link by the "Location:" text label, I see the following URL:

http://www.blogger.com/profile-find.g?t=l&loc0=US

See that last part of the URL, the &loc0=US part? That part of the address is being used to tell Blogger which country it should use in its search. If we could deduce the correct country code for Vatican, we can change the URL to get the desired results.

Fortunately, deducing the correct country codes is pretty easy. You just log in to your Blogger account, edit your own profile, and find the drop down list of countries under the "Location:" section. Using View Source in your web browser, find the list of countries. It should look something like this:

<select name="widget.country" id="widget.country" tabindex="0">
<option value="_nil_">Not Specified</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
. . .
<option value="VA">Vatican</option>
. . .
</select>

Obviously, I didn't list all the countries in the drop down list. I also bolded the specific entry we're interested in, so we now know that the country code for Vatican is "VA." That means if we switch the country codes on that previous search URL, we should wind up with:

http://www.blogger.com/profile-find.g?t=l&loc0=VA

The above URL will give us a page with all the Bloggers in Vatican. Don't take my word for it, though. I could be wrong, or something may have changed since I wrote this entry. If you click on the above link and get a list of profiles that all have locations in Vatican, then you know it (still) works properly. Now that you know the "trick" (i.e. find the correct country code, insert it into the URL), you can build your own "custom" links, save them as bookmarks, etc.

Of course, if you really want to be slick about it, you could build your own search form web page with a drop down list of all the countries and their corresponding country codes. (Look for that topic in an entry next week.)

Tuesday, August 19, 2008

Ten clues you are working with a bad web "designer"

I've been silent for years while web designers have criticized web developers for "making bad design." My silence ends today. Of course web developers make bad design-- we're DEVELOPERS, not designers. You don't send a pilot to do crowd control, do you?

So, instead of pointing out how web designers make bad developers, I'd like to provide something more constructive-- a list of clues to help you distinguish between legit, skilled web designers and the rest of the poseurs.

Here's the list:

1) The entire index page, including the text copy, is one big image and an image map. (Good luck if you ever need to change that text copy-- I wonder how much they'll charge you for that?)

2) They use tables to control layout because CSS positioning is "just too hard."

3) Their idea of creating thumbnail graphics is to change the width and height attribute on the img tag. (Why do these thumbnails take forever to download?)

4) Their CSS file has one line in it, and it reads: body { background: #FFF; font-family: sans-serif; }

5) Their pages have no DOCTYPE, or even worse, an incorrect one (e.g. STRICT DOCTYPE, but the page has deprecated HTML tags in it).

6) They've never heard of the W3C, the online HTML Validator, or Tidy.

7) They think Tim Berners-Lee is "that guy from Mötley Crüe." (Semantic Web? Sorry, I don't listen to New Wave.)

8) They use frames.

9) When you try to talk with them about any technical or maintenance issues caused by flaws in their design approach, they cut you off by saying, "That's not OUR problem!"

10) When you hire a different designer for your next web project, you get email and voicemails like this: "HOW COULD YOU DO THIS TO US? I THOUGHT WE WERE FRIENDS!?"

Sunday, August 17, 2008

Forget the jet pack; where's my Android phone?

Because I am a big Unix/Mac OS X geek, everyone assumes I have an iPhone. They are shocked when I say I'm not interested in purchasing one. There's nothing spectacularly wrong with the iPhone-- but it is locked down to AT&T's mobile network. I've spent time and effort unlocking my current GSM phone for use when I travel in foreign countries, so upgrading to another vendor-locked phone seems like a big step back to me.

But, I'm curious to see 2008 Q4 will bring with the new "Android phones." I'm not 100% sold on buying one yet, but if there's an unlocked quad-band GSM with a qwerty keyboard and a camera in the mix somewhere, I'd seriously consider it.

Sunday, August 10, 2008

Pecha Kucha Frustration

We finished our annual conference last week, and you know what that means: LOTS of POWERPOINT presentations. I've seen many "bad" Powerpoint presentations in the past 10 years. I've even delivered "bad" Powerpoint presentations myself. The tool's dynamic encourages "bad" presentations. It's like that "self-working magic trick" we all bought as kids-- the mechanics of the effect were so easy, we wound up showing it before we'd practiced our showmanship.

Which leads me to Pecha Kucha.

For those unfamiliar, Pecha Kucha is like haiku for visual presentations. It has a specific form-- 20 slides, displayed for 20 seconds each. Thus, if one remains true to the form, a presentation will last 6 minutes, 40 seconds. I admit, it sounds gimmicky-- but it also sounds better than the typical Powerpoint marathons we've all endured. I suspect Pecha Kucha's constraints force its followers to learn the craft of showmanship.

I'd like to try this format myself, but I don't use Windows or Microsoft Office on any of my personal machines. All the presentation software to which I do have access, such as Google Docs, doesn't appear to have an timed transition that automatically moves from one slide to the next. The nearest approximation I can make is using the screen saver feature on my iBook that can be set to display image files kept in a specific order-- but the delay between transition effects seems to be hard-wired at precisely 8 seconds.

A List Apart 2008 Web Survey

I know I'm probably preaching to the wrong audience here, but--

If you build web sites for a living in any capacity (designer, developer, tester, what have you), you should seriously consider taking the 2008 Web Survey over at "A List Apart."





(Of course, chances are that if you do build web sites for a living, you already knew about "A List Apart" and their 2008 Survey and have discovered better sources of info than my Atom feed. LOL!)

Friday, August 8, 2008

A prediction about the Ivins Investigation

Yesterday, I read an article in the DC Examiner that featured "poems" the alleged anthrax attacker sent via email to a friend. Bear in mind, I don't know anything about biological weapons-- but if I were some kind of homicidal, evil genius capable of producing anthrax at a facility that doesn't even have the right equipment for it, while leaving no traces of it in my car or house, I think I could write a poem that wasn't based on "I'm a little teapot."

Prediction: The Ivins investigation isn't going to hold up under critical scrutiny and its findings will be discredited.

Saturday, August 2, 2008

Bluejacking in the USA

I saw my first instance of bluejacking (i.e. using Bluetooth technology to send unsolicited advertising messages) today. It's peculiar, but Bluetooth hasn't caught on state-side like it has in, for example, Europe. You could probably rationalize reasons-- such as concerns about privacy and security, etc.-- but I think the truth is most people here buy consumer electronic devices for status, rather than actual function. They never read the manual in its entirety to learn all the features of their products.

But, I digress.

So, I'm at the food court in Springfield Mall in Northern Virginia, and there's this National Guard poster in one of the kiosks telling people to turn on their Bluetooth and set their devices for autodiscovery. My current cell phone doesn't have Bluetooth support, but I expect if I had, I would have received some URL to their recruiting site.

On the one hand, I'm glad to see that someone out there is at least aware of Bluetooth and making use of it. On the other hand, I was disappointed with the overall implementation. I'm not even talking about the necessity of the poster to let people know the Bluetooth service was available (though it is kind of laughable, I have to admit). The local mall management could have made outstanding use of the Bluetooth technology-- with links to promotional events, maps in case people get lost, information about the mall's hours of operations, weather conditions, movie times, the location of the lost and found, etc.

So much possibility exists-- and instead, we get adverts for the National Guard. (Nothing against the National Guard, mind you. I think they perform a wonderful service for our country.)

It's just like buying the deluxe cable TV package from your local cable company and discovering that 20 of the channels are all shameless self-promotional channels. (Hello, we're already subscribing to the service-- why are you subjecting us to advertising on channels that could be used for educational or entertainment programming instead?)

If/when I get my Personal Area Network up and running, it's going to be a hell of a lot cooler and more valuable than just advertising. I don't know exactly what I will offer, but if all I can think of to say is: "Come join our team!" then I'm hanging it up before I even get started.

They actually have programs for Bluetooth enabled devices that let users declare what their hobbies and interests are-- and when they wander into close proximity of someone else with a similarly equipped/enabled Bluetooth device, the programs compare interests and hobbies. If they find a significant degree of matching, the programs alert the users to the other person's presence. (I can't help but think of Dr. Who and how the TARDIS automatically translates all the various written and spoken languages from around the universe for travelling companions via telepathic interface. Remarkably powerful and convenient, yet so subtle that you forget it's there.)