Nitin Khanna

I was once described as a philosopher programmer. I think I'd like to describe myself as a lifelong student.

What Facebook needs to do next

Update: Facebook has done it! It has finally created a messenger standalone for the web. You can go here to check it out (here if that doesn’t let you login) or here to read about it (but why would you?). Cheers!

Facebook has changed a lot over the past few years. There have been acquisitions, newsfeed, design changes and rollbacks and a whole mess of things. Facebook obviously understands that the future is mobile (hence WhatsApp and Instagram) and that people are moving in all kinds of directions, towards private spaces (hence the separate Messages app) and public posts (hence hashtags and the searchability of your FB post that goes with those).

So what’s next? Well, today, I wanted to send a link to my brother. Since I’m on Windows right now and not on my Mac (I usually just iMessage links to him), I fired up Facebook and sent it to him in a message. Why? Because it’s convenient, because Facebook detects the OpenGraph information about the page and processes it to make a neat link+image combo and because we have many conversations on there anyways.

Why didn’t I send it to him as a directed Facebook post? I could have, but I didn’t care enough to make it public. Our Facebook activity is not our true selves but a reflection of what we want to portray to others, and this link didn’t necessarily fit into any paradigm of my public self. (In other words, it wasn’t epic. Publicly shared links must be epic.)

Why didn’t I send it to him in an email? Hush, don’t ask silly questions.

But then, I wanted to send him another link and another. So what did I do? I clicked on that miserably little link that takes me to Facebook’s dedicated messages page so that I could share links and have conversations in a larger space than that goofy little box that occupies the bottom right corner of my screen.

That’s when it hit me. Facebook has a beautiful Messages app on the iPhone. I’ve sung praises of it before. But there’s a curious lack of a well designed web interface for messages. The old and clunky interface that sits there now has been sitting untouched since a long time.

Now, you’d argue that another private space that I could have used was the Facebook Groups feature. It looks nice, it’s often updated and has the same look-and-feel as the rest of Facebook. But why would I create a group for just myself and my brother? There’s no need for that since /messages exists. The only thing needed is to build a nice looking private messages space that people would use.

I was really tempted, as I started writing this post, to build this webapp myself. Facebook’s API is open and easy to work with. I’m sure I could have found many plugins and libraries to make the task easier for me. But any such project can never be feature complete. I can build it and you can come, but you’ll never stay because of lack of features, because a single guy sitting with a laptop with a limited amount of time can only do so much.

So Facebook, here’s the next thing you need to do – make messenger.com what it really should be – a full-fledged webapp that’s as classy as any other public facing feature of Facebook. I hope to see it soon!

Cities

Hunkered, cowering, crawling
The masses seething through
An urban jungle sprawling
Sky and stone of same hue

Eyes lowered, heavy
Watching furtively, each stranger
With hopes and dreams, heady
Covered, guarded from each danger

Rain splashing on head and face
As we walk to our destinies
Some to fame’s embrace
Most, to life’s inequities

What if one day, we were to rise
Leave back this dreary, endless ride
Catch the light before it dies
To claim some day that we too tried

But that is for another day
There is work yet to be done
Cash the check, claim some pay
A race yet to be won

And so one sees
The masses seethe
As endless drops in endless seas
With gray up top and gray beneath

A response to NYTimes’ OpEd on Religion in India

The New York Times has published a Christmas OpEd piece (yesterday online and today in print) that talks about religious intolerance in India and how ‘hindu militants’ are forcing conversions of Muslims and Christians and has blamed our PM, Narendra Modi for not doing enough to stop this and other attacks.

Initially, I wanted to write a long and deeply researched rebuke of this kind of hypocrisy, but I’d rather let a picture say a thousand words –


Continue reading

Fixing Jetpack’s Stats module

Despite the hate that Jetpack gets for being a bloatware plugin, it is one of my favorite and the first step whenever I setup a new WordPress install. However, Jetpack does have a few irritating habits that I cannot overlook. One of these is the stats module. The module actually does pretty well, posting data to the wordpress.com dashboard and making it easy for me to quickly glance at the number of visitors I’ve had for the day.

However, every so often the module craps out and logs a large number of visits from crawlers, bots and spiders as legitimate hits, since those are not in the official list of crawlers, bot and spiders to look out for. To fix this, I went out to look for the list and to add to it. One quick GitHub code search later, I found that the file class-jetpack-user-agent.php is responsible for hosting the list of non-humans to look out for. What I found inside was actually a pretty comprehensive list of software, but one that definitely needed extending.

If you want to do what I did, find the file in your WP installation at –
/wp-content/plugins/jetpack/class.jetpack-user-agent.php

Inside the file, look for the following array variable –
$bot_agents

You’ll see that the array already contains common bots like alexa, googlebot, baiduspider and so on. However, I deepdived (meaning did a sublime text search) into my access.log files and found some more. To extend the array, simply look for the last element (which should be yammybot) and extend it as follows –
'yammybot', 'ahrefsbot', 'pingdom.com_bot', 'kraken', 'yandexbot', 'twitterbot', 'tweetmemebot', 'openhosebot', 'queryseekerspider', 'linkdexbot', 'grokkit-crawler', 'livelapbot', 'germcrawler', 'domaintunocrawler', 'grapeshotcrawler', 'cloudflare-alwaysonline',

Note that you want to leave in the last comma, and you want all the entries in lower case. This doesn’t actually matter, because the PHP function that does the string compare is case-insensitive, but it just looks neater. You’ll also notice that I’ve added the precise names of the bots, like ‘grokkit-crawler’ and ‘clousflare-alwaysonline’ but you can be less specific and save yourself some pain. This will, however, affect your final stats outcome.

Notes –

  1. Some of the bots are pretty interesting. I saw tweetmemebot, which is from a company called datasift, which seems to be in the business of trawling all social networks for interesting links and providing meaningful insights into them. Another was twitterbot. Why the heck does twitter need to send out a bot? We submit our links to it willingly! Also interesting were livelapbot, germcrawler and kraken. I have no idea why they’re looking at my site.
  2. Although Jetpack does not have a comprehensive list of bots, it still does a pretty good job. I found the main culprit of the stats mess in my case. Turns out, CloudFlare, in an effort to provide their AlwaysOnline service (which is enabled for my site), looks at all our pages frequently and this doesn’t sit well with Jetpack. I hope this tweak will fix this now.
  3. Although this fix is currently in place, every time the Jetpack plugin gets updated, all these entries will disappear. That’s why this blog post is both a tutorial for you all and a reminder and diary entry for me to make this change every time I run a Jetpack update. However, if someone can tell me a way to permanently extend Jetpack, or if someone can reach out to the Jetpack team (hey Nitin, why don’t you file a GitHub issue against this?) it’ll be awesome and I’ll be super thankful!

Update – I was trying to be hip and did a fork of Jetpack and GitHub, made the changes and then tried to make a pull request. Turns out, I don’t know how to do that, so I opened an issue instead. It sits here.
 

[Fiction] How the seasons came to be.

There once was a King who had two great scientists in his court. He encouraged them to discover the laws of the world and loved hearing of their discoveries in court. One day, the scientists came to him and told him that they had calculated precisely, the time it takes for the Day and the Night to come and go from the Kingdom. They told him of twenty-four of what they called hours, split into minutes of sixty each and each of those of minutes went on to become sixty seconds.

The King was delighted! Long had he wanted to know how time went on, how the day turned into the night and when he could tell his people to come visit him. Now he had that means. He could tell his people when the court of the King would start and his spies that their visitation would have to be at a set time of the night. Continue reading

Real people don’t fit them

I love Jessica Hagy‘s site Indexed. It’s funny, published weekdays and is almost always spot on.

But, I found a problem with today’s post –

Stereotypes. Yup.

Jessica’s “Real People don’t fit them”


I don’t think you can portray a groups vs individuals analysis on a graph. So, I fixed it in my own way. Hope you like it and hope you check out her website. It’s pretty cool!

My version –

IMG_0233.JPG

 

Of course, Hagy’s Indexed is for fun and not to be taken as seriously as I have. But hey, when you see something wrong on the Internet, you fix it, right?

Kill all the Uruks

I spent the weekend listening to my brother complain about how the story in the game he’s playing nowadays, “Middle-Earth: Shadow of Mordor”, is not progressing fast enough. As it turns out, the problem was that he had to kill a lot of middle level orcs (uruks) in order to entice the next level of villains to come out of hiding. He proceeded to do that and voila, the story line moved quickly after that.

Life’s a lot like that. You start out green at any task and you have a lot of enthusiasm and beginner’s luck. That makes you happy and you expect the same level of progress to keep up. Turns out, there’s a lot of work between that first instance and getting to a decent level of expertise. All it takes is consistent hard work. It’s not the neat solution. It’s the only solution.

Since it’s NaNoWriMo, here’s a tip – when you’re doing something, anything actually, and you start out with a bang, don’t forget to put your head down and consistently kill the uruks.

Word of the Day: Fungible

Fungibility, according to Wikipedia, is an economic term used to describe the property of a commodity whereby it is directly interchangeable with something else. For example, if you don’t care whether the rental car you get is a Mercedes or a BMW, then they are fungible. It was used by journalist Stijn Debrouwere in an awesome article about the future of newspapers and media companies in the age of the Internet, by calling his article –

A treatise on fungibility, or, a framework for understanding the mess the news industry is in and the opportunities that lie ahead.

Source: Fungible

Continue reading

License, don’t acquire

Silicon Valley has a bad habit – that of buying outright any company that might prove useful to them and the tech community. When Google bought Waze, Facebook bought Spool and Pinterest bought Icebergs, they all did it to bring to their platforms, users and companies, ideas, technologies and features that they believed would be a good fit with their own setup.

But they did it wrong. Waze is a great app and when it finally disappears (as do all Google acquisitions), it will be a great loss for it’s users. Waze has a unique UI, a dedicated user following and features that are not at all present in Google Maps. While the integration went well, Google Maps is an overloaded app with too many features. Eventually, they’ll simplify and drop a few features, getting rid of many core things that Waze is known for. In no circumstance will Waze ever recover from this setback.

Continue reading