Orange Sky, with Birds

Charles Johnsonfollow me on twitter
Images • Tue Feb 9, 2010 at 10:59 pm PST • Views: 283

Camera: Canon Powershot G10. (The newer model is the Canon PowerShot G11.)

Advertisement

Onion: Worm Alert

Charles Johnsonfollow me on twitter
Humor • Tue Feb 9, 2010 at 6:53 pm PST • Views: 233

Tech Note: Retweet Code Revamp

Charles Johnsonfollow me on twitter
Technology • Tue Feb 9, 2010 at 4:25 pm PST • Views: 414

Here’s an email I recently received from the URL-shortening service bit.ly, a popular Twitter-related service that I use to automatically shorten URLs for LGF-related tweets. The nice thing about bit.ly (and j.mp, it’s the same service) is that it doesn’t just shorten URLs; if you register an account, it also tracks some interesting statistics for any URLs you shorten. And they make these statistics available to outside developers through the bit.ly API; this is how our Retweet buttons are able to show the number of clicks on each shortened link.

But apparently, LGF has been hammering their API servers too hard.

Hi,

I’m writing in regards to your bit.ly API usage. You are making an unusually large number of shorten requests to our API (often over 50,000/hour), and it looks like you are doing this on page load (for the Twitter button on pages such as http://littlegreenfootballs.com/article/35599).

Normally it is best not to make /shorten requests on a page load, but instead to make a /shorten request to bit.ly when a user clicks a share button. You can find an example of that at code.google.com. We are increasing our application of rate limits to manage abusive API users, and we encourage you to make the above fix as soon as possible to ensure that your site continues to function normally. I’d be glad to discuss this further and/or answer any questions you have, and thanks for using bit.ly!

The problem was related to the John Resig Retweet button, which I wrote about in this Tech Note. When the LGF home page loaded, the Retweet button Javascript code called the bit.ly API’s “shorten” function to find out the shortened URL, followed by the “stats” function to get the number of clicks, for each post, every time the page was loaded. As you can imagine, with 80,000 to 120,000 pageviews a day, that’s a lot of API calls. No wonder they noticed it.

I’ve vastly reduced the number of API calls now with the latest code refactoring of the Retweet button. I stopped using John Resig’s Javascript code (no hard feelings, it’s great for most sites but not LGF), and wrote my own jQuery routines that use Ajax to call a server-side script when the page loads, passing it the necessary data on every Retweet button in the page in JSON format. The Ajax server calls the API’s “stats” function, then sends back (again in JSON) the number of clicks and some other data. The jQuery code then displays those numbers in the Retweet buttons.

The key to reducing our API calls is that the shorten function is only called once, not when the page loads but when a new entry is posted to the LGF blog. The shortened URL is used to automatically tweet about the new post on Twitter, then it’s saved along with the new entry data, to be reused endlessly as needed without ever calling the API again.

Previously, the Resig code would call the API’s “shorten” routine and the “stats” routine for every post. Now the PHP Ajax server uses the saved bit.ly (or j.mp) URL to call the API’s “stats” routine only, which should cut our API usage in half. And retrieving statistics should be a much less costly operation for the server than shortening a URL. Hopefully, this will bring us back within the bit.ly API usage limits.

And since this is probably Venusian to most LGF readers, consider it an open thread from here on out…

So. Carolina GOP Converging with Tea Partiers

Charles Johnsonfollow me on twitter
Politics • Tue Feb 9, 2010 at 1:28 pm PST • Views: 426

The South Carolina Republican Party apparently feels that they aren’t conservative enough yet, so they’ll be uniting with tea party groups. That ought to do it.

The South Carolina Republican Party announced Monday that it’s uniting with tea party groups in the state to share resources, coordinate messaging and push the GOP in a more conservative direction.

The points of contact between the state party establishment and the grass-roots will be the Greenville County Republican Party — one of the most conservative wings of the state party — and the Upstate Coalition of Conservative Organizations, an umbrella structure of state tea party groups.

The agreement, as announced by South Carolina Republicans, is designed to serve four goals: increase precinct involvement, improve communication between the state party and grass-roots groups, create liaisons between the state party and the various tea party organizations and to work “closely to make the Republican Party more conservative.”

Now there’s a winning formula.

Pamela Geller Shrieks on Joy Behar

Charles Johnsonfollow me on twitter
Blogosphere • Tue Feb 9, 2010 at 10:10 am PST • Views: 1,328

Pamela Geller’s appearance last night on the Joy Behar show with Ron Reagan and Stephanie Miller perfectly demonstrates why Geller has become known on the Internet as the “shrieking harpy.”

Geller actually seems to think she came off well on this show, in which she tells Ron Reagan what his own father would have thought about Sarah Palin, and rants continuously like a howler monkey on crack throughout the whole segment. Notice that it ends as Joy Behar tells Geller, “You have not shut up.”

This obnoxious performance was a big hit on the wingnut blogs, of course.

Pamela Geller is a full-on, raving Birther. She tried to claim Barack Obama is the love child of Malcolm X, and she wasn’t kidding. She regularly uses terms like “libtard,” calls President Obama “Hussein,” and often compares him to Adolf Hitler. She promotes the neo-Nazi British National Party, and praises other fascist groups like the English Defense League and the Vlaams Belang. She doesn’t just criticize radical Islam; she’s a flat out, bigoted Muslim-hater who believes that every single Muslim is a terrorist by nature. And she has the personality of a treacherous rattlesnake.

If Joy Behar was trying to make the right wing blogosphere (and fans of Sarah Palin) look terrible, she couldn’t have picked a better person.

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Account Settings Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► LGF Hits

► Resources

► Never Forget

► Statistics

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

Nobody's human.

TwitterFacebook
LGF Pages
Recent Pages

Bob Dillon
NYPD 'Stop and Frisks' Hit All-Time High
11 minutes ago
Views: 12 • Comments: 0
Tweets: 0 • Rating: 0

Look At My New Grandbaby!
Fashion Week 2012: Unpaid Internships Challenged After Intern Files Lawsuit
54 minutes ago
Views: 54 • Comments: 0
Tweets: 1 • Rating: 0

RanchTooth
Blogosphere Screams UN Conspiracy
57 minutes ago
Views: 43 • Comments: 0
Tweets: 0 • Rating: 0

Channeling Confucius
Misery in Athens : 'New Poor' Grows From Greek Middle Class - Der Spiegel
1 hour, 25 minutes ago
Views: 44 • Comments: 1
Tweets: 0 • Rating: 1

Channeling Confucius
8 Unexpected Downsides of the Switch to E-Books
1 hour, 59 minutes ago
Views: 75 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
The Moral Calamity of Serving in Congress
2 hours, 15 minutes ago
Views: 63 • Comments: 0
Tweets: 0 • Rating: 0

Channeling Confucius
Occupy Fights the Law: Will the Law Win?
3 hours, 2 minutes ago
Views: 54 • Comments: 0
Tweets: 0 • Rating: 0

Look At My New Grandbaby!
iSlaves: Forced Labor Key to Apple Profits
3 hours, 23 minutes ago
Views: 86 • Comments: 0
Tweets: 2 • Rating: 2

Randall Gross
Police: Iranian blows off legs in Bangkok blast
3 hours, 32 minutes ago
Views: 114 • Comments: 0
Tweets: 0 • Rating: 2

Randall Gross
Wakefield Anti-Vaxxer Accomplice appeals ruling
3 hours, 46 minutes ago
Views: 87 • Comments: 0
Tweets: 0 • Rating: 0

 Frank says:

The language and concepts contained herein are guaranteed not to cause eternal torment in the place where the guy with the horns and pointed stick conducts his business.