Twitter Follower Count via URL

Here is a quick tip to return a users twitter followers via a URL. The URL returns either XML or JSON by simply switching the targeted file. For example:

https://api.twitter.com/1/followers/ids.json?screen_name=candullo

This will output JSON, shown below for reference. If you would like XML in return, switch ‘ids.json’ to ‘ids.xml’. Also note the screen_name variable. You should know what that is.

Sample JSON return from Twitter:


{"next_cursor_str":"0","previous_cursor_str":"0","next_cursor":0,"ids":
[112419029,369480133,543227845,9081922,389620314,482381617,
406814796,473381272,208629427,15251303,466042209,145361708,99687348,
76556860,242279894,457257082],"previous_cursor":0}

Read the official Twitter documentation.

So what about the follower count? To get the follower count simply count the ‘ids’ node, a jQuery snippet is posted below.


var json = JSON.parse(YOUR_JSON_DATA);
var followers = json.ids.length;

That’s it.

Enabling cURL in XAMPP

By default XAMPP does not have cURL enabled. Below is a quick fix to enable it by editing the php.ini file.

1. Locate the /php directory inside your XAMPP installation.
2. Open php.ini (any text editor will do)
3. Find the line ;extension=php_curl.dll and remove the semi-colon, save your changes.
4. Stop the Apache service then start it again.

That’s it!

jQuery Input Focus/Blur

A quick snippet to clear an inputs default value on focus and revert to the original value on blur:



$('input[type=text]').focus(function()
{
if($(this).val() == (this.defaultValue)) $(this).val('') }).blur(function()
{
if(!$(this).val()) $(this).val(this.defaultValue)
});


The selector assumes input[type=text] only. You may add input[type=password], textarea, etc.

Sell your Rolex, cancel your Visa Card

Here is a list of companies that support SOPA and PIPA. I would expect RIAA and Time, but VISA and Monster Cable, come on. Half of these companies sell overpriced products to an uninformed public.

RIAA
News Corp
TimeWarner
Walmart
Nike
Tiffany
Chanel
Rolex
Sony
Juicy Couture
Ralph Lauren
VISA
Mastercard
Comcast
ABC
Dow Chemical
Monster Cable
Teamsters

New AIM iPhone App

AOL (that company which used to send you CD’s in the mail to use that awful software) has done something great. I’m talking about the new AIM application for the iPhone, more specifically it’s GUI.

They have redesigned everything including the brand (no more running yellow man, about time.) It’s interface is very sleek and intuitive, almost like the iPhone’s native iMessage with avatars and a cleaner, hipper look.

AIM iPhone App
See this beauty larger

Once more they have added another feature which allows you to connect with Facebook and Twitter.

Overall, good job AOL. How often have you heard that?