Monday, 3 January 2011

Update To The YOURLS – Twitter – Google Reader Script

I recently blogged, Using YOURLS And The Twitter API With Google Reader’s Custom SendTo Link. Since then, I have made a few improvements to the script, mostly in the error-trapping line.

  • I broke out the variables for the YOURLS API signature, plus the Twitter API consumer key, consumer secret, access key and access secret, and converted them to constants.
  • I removed urldecode() from the formation of the YOURLS API request. It’s not necessary.
  • I have added code to trap any errors in when making the short URL.
    • I am now getting the statusCode and message node contents, in case something goes wrong with the shortening.
    • I set the script to die on a URL shortening error, which is determined by the short URL being an empty string or the statusCode node having a value other than 200.
    • The code, coupled with the message, should explain any problems adequately enough to debug shortening issues. If you find you are getting zero-length responses from your URL shortening, that’s probably due to a server misconfiguration; possibly from bad mod_rewrite rules, possibly due to a messed-up cookie on your PC.
  • I strip HTML tags from the title.
    • I discovered today that some Google Reader items will have HTML markup in their titles, such as <em>.
  • I check for failure in the Twitter API request.
    • TwitterOAuth will return Boolean false if it could not complete its curl request to the API, and will return an XML document in any other case, including failure of the tweet to go through.
    • If the cUrl request is good but the tweet doesn’t go through, Twitter responds with an HTTP status code other than 200. We can capture the last status code returned by our request, test it, and print the XML response describing what happened.

Continue reading: Update To The YOURLS – Twitter – Google Reader Script »

Thursday, 30 December 2010

Using YOURLS And The Twitter API With Google Reader’s Custom SendTo Link

Update, January 3, 2011: There is a revision of this script at http://www.dougv.com/2011/01/03/update-to-the-yourls-twitter-google-reader-script/.

I love me some Google Reader. As I noted in the past, now that I understand it, I don’t know how I ever managed to get by without it.

One of my favorite Reader features is the ability to send a link of the content to several social media sources, such as Facebook, Twitter, Digg, Reddit and more. Even better, you can create a custom link to which you’d like to send Reader items.

I use a custom install of YOURLS to shorten links, in part because there have been some scares surrounding the long-term viability of many online link shorteners; in part, because I don’t like trusting that these link-shortening services won’t hijack my links, employ interstitial ads or do bad things with the data they collect; and in part because I want to see link-click statistics myself, including the underlying data.

Thanks to the custom link option in Reader, coupled with the Twitter API, I’ve come up with a PHP script that effectively replaces the built-in Twitter send to link in Reader, allowing me to use my install of YOURLS and to post automatically. (The Reader send to Twitter link actually opens the Twitter home page, pasting the title and Google-shortened link into the status tweeting box at the top of the page.)

Continue reading: Using YOURLS And The Twitter API With Google Reader’s Custom SendTo Link »

Tuesday, 7 December 2010

'Behind Every Great Fortune Is A Great Crime'

Federal postal authorities with Vitaly Borker after they arrested him on Monday at his home in Brooklyn.

Federal postal authorities with Vitaly Borker after they arrested him on Monday at his home in Brooklyn. Robert Stolarik for The New York Times

The headline to this post is via Chris Rock, who repeats that line during his “Never Scared” comedy special (link very NSFW!), speaking about the difference between being rich and being wealthy.

It means that significant, lasting wealth is often created by exploiting something new, or using some means to circumvent the kind of behavior most people would consider fair or reasonable. The patron of the exhaulted Kennedy clan made his fortune from bootlegging and insider trading before the 1929 stock market crash. Rockerfeller, Vanderbilt and Morgan were the great robber barons of the U.S. industrial revolution.

I mention this because Vitaly Borker, proprietor of decormyeyes, was arrested today on federal charges of “mail fraud, wire fraud, making interstate threats and cyberstalking.”

Borker, as you will remember from this blog, discovered some time ago that Google’s PageRank algorithm didn’t consider whether the mentioning of an online store was positive or negative. (Google claims this is no longer the case.) Therefore, Borker took a extremely combative approach to customer complaints, intentionally stoking animosity, so that his online store would appear in multiple online complaints, often at very reputable, PageRank-enhancing Web sites, such as Get Satisfaction.

It seemed to work well, and I admired the ingenuity behind it, if not the tactic itself. Seems now, however, that Borker will be a test case as to whether anti-service, and preying upon the gullible / lazy, is at an end. (I might also note that this is further proof that for all the caterwauling, good journalism isn’t dead; if anything, it’s more valuable than ever.)

All links in this post on delicious: http://www.delicious.com/dougvdotcom/behind-every-great-fortune-is-a-great-crime

Sunday, 28 November 2010

Google Search Results Encourage New Wave Of Negative Customer Service

A fascinating article in today’s New York Times examines the case of DecorMyEyes, an online eyeglasses retailer who’s found an interesting exploit in Google’s search rankings.

Noting that Google’s PageRank algorithm doesn’t determine if a linkback to a Web site is positive or negative, store owner Vitoly Borker games that system simply: He fights every customer complaint bitterly, with verbal abuse, counter-complaints, and what some construe as overt threats of violence.

(Update, Dec. 2, 2010: Google has changed its PageRank algorithm to weigh the negativity of comments.)

This aggressive, seemingly destructive behavior is so over-the-top, it leads disgruntled customers to complain everyplace they can online, including at such massive entities as Get Satisfaction.

The long and short: Lots of mentions and links to his Web site, plus lots of mentions of the brands he sells, all in context, often on high-traffic Web sites, means searching for a specific pair of eyeglasses often leads to Borker’s Web site being listed first in a Google search.

Borker effectively preys on the inexperienced online shopper. “If you’re the type of person who reads consumer reviews,” says the Times, “Mr. Borker would rather you shop elsewhere.”

He gets away with it via a combination of apathy and obeying the letter of the law.

His previous hosting company and eBay (from where he buys glasses for resale)  ignored scores of complaints until the Times inquired about his accounts. The confusion law enforcement has over Web-based commerce crime, including the IC3, means police have largely been absent, even in the face of obvious violations of the law.

Borker carefully monitors Visa and MasterCard complaints, making sure he doesn’t go past the monthly complaint limits. After MasterCard closed one of his merchant accounts, he opened another:

“There is no such thing as shutting someone down on the Internet,” he said during our initial telephone interview. “It isn’t possible. If Visa and MasterCard ever shut me down, I’d use the name of a friend of mine. Give him 1 percent.”

Most interesting, Borker sells on Amazon.com’s Marketplace, and doesn’t employ any nastiness there, because Amazon has a very low tolerance for customer complaints, according to the Times.

Continue reading: Google Search Results Encourage New Wave Of Negative Customer Service »

Saturday, 27 November 2010

Chrome Just Isn’t Up To Firefox’s Snuff

Three weeks ago I decided to give Google ChromeGoogle Chrome Logo a shot at replacing Mozilla Firefox as my primary browser. And believe me, it was a fair contest: I only called upon Firefox when I could not get Chrome to work.

Unfortunately, I had to call on Firefox at least once every other day. And while I still run across the occasional Web site that requires me to use Internet Explorer — mainly, Web sites that use some Microsoft technology, such as LiveMeeting or an ActiveX control of some sort — that’s maybe once or twice a month.

(And no, I have not given IE a chance to be my primary browser. When it truly embraces Web standards, then I will consider it. Internet Explorer is barely in the neighborhood of standards compliance right now, never mind on the same street. Safari? C’mon, man. Opera? Seriously, stop now, you’re embarrassing yourself.)

So I’ve made up my mind: Chrome gets sent back to the minors to work on its skills, and Firefox — older, fatter, slower, but far more dependable and experienced — is back as my ace starting pitcher.

Continue reading: Chrome Just Isn’t Up To Firefox’s Snuff »