Friday, November 8, 2013

The Technology Hidden Inside EVERY Tweet

Tweet

Consider the tweet. It’s short — 140 characters and done — but hardly simple. If you open one up and look inside, you’ll see a remarkable clockwork, with 31 publicly documented data fields. Why do these tweets, typically born of a stray impulse, need to carry all this data with them?
While a tweet thrives in its timeline, among the other tweets, it’s also designed to stand on its own — forever. Any tweet might show up embedded inside a million different websites. It may be called up and redisplayed years after posting. For all their supposed ephemerality, tweets have real staying power.
Once born, they’re alone and must find their own way to the world, like a just-hatched sea turtle crawling to the surf. Luckily, they have all of the information they need in order to make it: A tweet knows the identity of its creator, whether bot or human, as well as the location from which it originated, the date and time it went out, and dozens of other little things — so that wherever it finds itself, the tweet can be reconstituted. Millennia from now, an intelligence coming across a single tweet could, like an archaeologist pondering a chunk of ancient skull, deduce an entire culture.
Twitter’s initial public offering Thursday marks the San Francisco, Calif.,-based company’s coming-out party, the moment when it graduates from its South of Market beginnings and takes its place as one of the Internet’s most valuable properties, without ever turning a profit. What’s perhaps most remarkable about Twitter’s rise is how little the service has evolved from the original core concept of the 140-character tweet — which is to say, not at all. It’s tempting to view tweeting as silly and trivial, and Twitter itself as overhyped and overvalued. But there’s some sophisticated, supple and even revolutionary technology at work. Appreciating Twitter’s machinery is key to understanding how an idea so simple changed the way millions of people advertise their existences to the world.
How do you look inside a tweet? It’s easy; the structure of a tweet is a matter of public record. Twitter, as a modern Web company, reveals to the world some of the technology it uses, in the form of an application programming interface — an API — which allows external software developers to build tools on top of the service, making it more widely used and thus more valuable for everyone.
All tweets share the same anatomy. To examine the guts of a tweet, you request an “API key” from Twitter, which is a fast, automated procedure. You then visit special Web addresses that, instead of nicely formatted Web pages for humans to read, return raw data for computers to read. That data is expressed in a computer language — a mashed-up nest of brackets and characters. It’s a simplified version of JavaScript called JSON, which stands for JavaScript Object Notation. API essentially means “speaks (and reads) JSON.” The language comes in a bundle of name/value fields, 31 of which make up a tweet. For example, if a tweet has been “favorited” 25 times, the corresponding name is “favorite_count” and “25” is the value.

No comments: