2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 8,700 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 15 years to get that many views.

Click here to see the complete report.

ConsoleBitly – A thin wrapper around the bit.ly

bit.ly, the web service that offers shortening of long URL’s was something that I was quiet frequently using all the, because it was easy for me to remember some of the long URL’s. So I often used to visit their service, paste in my long URL and get a short URL. So, I just thought of checking out their API methods because I was really bored of visiting their website every time and their API documentation was in fact helpful to me. The API did not just only include shortening of URL’s, but also expanding them, looking up for a bit.ly URL associated for a specific URL and much more.  And, hence I decided to write a class that would wrap around most of the useful methods of the bit.ly API.

I am a beginner to the Python programming language, and I am just loving every bit of Python. So, I decided to write the class in Python, that would display me the results in my Linux terminal.

The below link, consists of all the necessary documentation of using this API.


Display JSON data using jquery/ajax

JSON –  Javascript Object Notation, is one of the beautiful techniques for parsing data. It’s beautiful primarily because it is light weight!

Here, I’m going to demonstrate how to display JSON data using ajax and jquery.

Let’s read some sample json data that is available in a file called json.test.js

 "LinuxID":"1","LinuxDist":"Debian","Company":"Debian Project"<br>
 "LinuxID":"2","LinuxDist":"Ubuntu","Company":"Canonical Ltd."<br>
 "LinuxID":"3","LinuxDist":"Fedora","Company":"Fedora Project"<br>

Now let’s write the html and javascript to display these results:

We call this file called displayjson.html:

<!DOCTYPE html>
<title>Display JSON data</title>
<div id="results"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
var obj=jQuery.parseJSON(data);
for(var i=0;i<obj.length;i++){
$("#results").append("Linux ID: "+obj[i].LinuxID).hide().fadeIn(500);
$("#results").append("<br>Linux Distribution: "+obj[i].LinuxDist).hide().fadeIn(500);
$("#results").append("<br>Company: "+obj[i].Company).hide().fadeIn(500);


Check out examples at Fun with JSON.
That’s it folks, enjoy!