SQL Kung Fu All Over

February 16, 2009

I’ll admit right now that in terms of SQL Kung Fu, I’m the guy who gets his ass handed to him by Bruce Lee at the beginning of the movie. You know the guy, his name in the credits is like “Henchman #24” or something equally generic. But hey, hacking on queries and trying to shoehorn data into proper formats is fun and doesn’t involve extolling the virtues of EAS devices.

We have our product catalog listed up on Google Base in case people search for barcode scanners and want to buy through their vector instead of clicking ads or researching other price comparison sites. By the way, Google Base is free and gets a fair amount of traffic. Unfortunately, sometime last week they tightened their restrictions on something that caused our full catalog to be disapproved. This is only exacerbated by the fact that they don’t provide a reason, just a list of what can cause a product to be disapproved.

I pour over the rules, and strip out products with prices under a dollar, products that may not have a clickout url, and anything with weird or missing information. Apparently Google doesn’t like those. Nor do they like selling limbs, currency, or means for defrauding people. Good thing we don’t sell anything like that, we’d be out of luck.

But still, after cleaning out old weird stuff, we’re disapproved. Now I feel like the kid who does everything he can to win approval but only receives ambiguous reasons for what may be wrong. Instead of drawing on the wall in crayon, I start hacking on the clickout urls.

Previously we used product urls that had anchors linking to the option on the page. So you’d see:

http://www.posguys.com/barcode-scanner_3/POS-X-Xi3000_716/#XI3000U

to get you to the USB Xi3000. I guess Google was done with that, so I had to replace the url with:

http://www.posguys.com/barcode-scanner_3/POS-X-Xi3000_716/XI3000U_9177/

so now it links directly to the option as opposed to the product page.

The big problem with this is that weird random characters were up in the part number field, so I was getting leading spaces and asterixes all over the place, blowing up links. A  replace statement removed the asterixes, but not the spaces. I hate spaces, they’re totally lame. But new to me, you can nest replace statements without blowing anything up, and so the URL is mostly scrubbed of crappy data, making my life easier and now Google approves of our feed.

But again, this is weak kung fu. Not even like sweep the leg no mercy stuff. Maybe like painting the fence or waxing the car. But I’m excited and that’s all that matters.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: