All posts tagged ‘Twitter’

File Under: APIs, Web Services

Twitter Tells Tumblr: No Friends for You

We hope you weren’t planning to find your Twitter friends outside of Twitter because pretty soon it will likely be impossible to do so.

Twitter has slowly but surely been cutting out major third-party sites, preventing then from offering a “Find Twitter Friends” search feature.

The latest third-party site to lose access to your Twitter contacts is, as Buzzfeed’s Matt Buchanan first noted, hosted blogging service Tumblr. Previously Twitter has cut off LinkedIn and, more recently, photo-sharing site Instagram.

Tumblr still offers a way to find your friends on the service by searching either Gmail contacts or Facebook friends.

Earlier this month Twitter put third-party application developers on notice, saying that the social network arguably built on the backs of third-party developers no longer needs them. Twitter has also been cutting off third-party social networks like Tumblr, Instagram and LinkedIn.

Twitter’s API rules aren’t entirely clear, but the company’s overall position seems to be that developers — including big third-party sites like Tumblr — should be putting their content into Twitter, but not taking anything back out.

That stance, along with the user limits on third-party client software, has soured many developers on Twitter. Thus far though there doesn’t seem to be a mass exodus of angry developers abandoning Twitter. That may simply be because, at the moment, there’s nowhere else to go, though, as always, the open web offers a solution.

File Under: APIs, Social, Web Basics

One Foot on the Platform…

There’s an old and wonderful Little Feat song.

Lowell George’s girlfriend can’t make up her mind. How he describes it is what’s so cool. “She’s got one foot on the platform, the other on the train.”

And that’s the best strategy, right now, for a reporter or blogger using Twitter.

You can’t get off the platform, that’s where everyone is. But you need a Plan B, just in case you have to get off the platform. That’s the train.

You need a tool that allows you to publish to Twitter, and at the same time publish to an open system that can be connected to other open systems. So users can create their own Twitter, the same way they use Twitter to follow many sources, without having to go through Twitter.

Twitter is the platform. The feed is the train.

It might sound complicated, but it’s not.

If Twitter were to cancel my account, I would keep posting, and people who followed me on the train (following the analogy) would continue to get my updates. The people on the platform, however — would not.

It’s how we develop strength, and the power to choose, without leaving Twitter.

If Twitter Corp plans on being nice to us, then they should not have a problem with this approach. Their API permits it. It’s consistent with Dick Costolo’s edict that we should put stuff into Twitter, but not take stuff out of it.

It’s a way to preserve journalistic integrity even if Twitter hasn’t yet figured out if it’s in the business of providing a platform for journalism.

This post first appeared on Scripting News.

Dave Winer, a former researcher at NYU and Harvard, pioneered the development of weblogs, syndication (RSS), podcasting, outlining, and web content management software. A former contributing editor at Wired magazine, Dave won the Wired Tech Renegade award in 2001.
Follow @davewiner on Twitter.
File Under: JavaScript, Web Basics

Twitter Declares Everything Old New Again

Twitter is optimizing its web interface for speed, ditching several of the supposedly cutting-edge changes it made with the “new Twitter” revamp from 2010. The new Twitter redesign was controversial for its use of hashbang (#!) URLs and because it used JavaScript to build the entire page, content and all.

Now Twitter is returning to tried-and-true server-side methods of building webpages. It turns out using JavaScript to do everything is not such a good idea, at least not if you want your website to be fast.

Twitter says that returning to traditional means of serving webpages “dropped the time to first Tweet to one-fifth of what it was.”

Even better news for those concerned about the future of the web and the longevity of URLs is the news that Twitter is getting rid of its hashbang URLs. The hashbang syntax was originally designed to allow Google’s spiders to crawl Ajax content — content loaded dynamically — but sometime in 2010 hashbang URLs started popping up all over the web, including at Twitter.

The hashbang syntax works well if you use it as it was designed, to surface Ajax content that would otherwise be missed by Google. But it was always an awkward hack, not a cornerstone on which to build a well-designed URL, and extending it beyond its intended use often proves disastrous (as sites like Gawker can attest).

Twitter will begin phasing out hashbang URLs in the coming weeks, starting with its tweet permalink URLs.

Much of the write-up about the new speed enhancements on Twitter’s engineering blog reads like a web development best-practices tutorial from 2001, but there are some new ideas lurking toward the end, where Twitter Engineering Manager Dan Webb outlines Twitter’s new module-based JavaScript loading methods, built around CommonJS.

“We opted to arrange all our code as CommonJS modules,” writes Webb, “This means that each piece of our code explicitly declares what it needs to execute.” In other words, each piece of code is aware of what other pieces it needs to work. That means Twitter can tune how it bundles its code, “lazily load parts of it, download pieces in parallel, separate it into any number of files, and more — all without the author of the code having to know or care about this.”

Webb doesn’t mention Twitter’s front-end toolkit BootStrap in his post, but rolling together CommonJS and Twitter’s own dependency builder — which Webb says is similar to the RequireJS optimizer — sounds like a great addition for BootStrap 3.0.

Twitter Catches the ‘SPDY’ Train

Twitter has embraced Google’s vision of a faster web and is now serving webpages over the SPDY protocol to browsers that support it.

SPDY, pronounced “speedy,” is a replacement for the HTTP protocol — the language currently used when your browser talks to a web server. When you request a webpage or a file from a server, chances are your browser sends that request using HTTP. The server answers using HTTP, too. This is why “http” appears at the beginning of most web addresses.

The SPDY protocol handles all the same tasks as HTTP, but SPDY can do it all about 50 percent faster.

SPDY started life as a proprietary protocol at Google and worked only in the company’s Chrome web browser. SPDY has since won support elsewhere. Firefox will have SPDY support when version 11 hits prime time in the near future [Update: As Mozilla’s Chris Blizzard points out, SPDY is disabled by default in Firefox 11. If you’re using the beta and want to give it a try, you’ll need to visit about:config, search for network.http.spdy.enabled and set the value to true. If all goes well SPDY will be turned on by default in Firefox 13.]. Amazon also baked SPDY support into its Silk browser for the Kindle.

The IETF’s HTTPbis Working Group — the standards body charged with creating and maintaining the HTTP specification — is now considering adding SPDY to HTTP 2.0, which will improve the speed of HTTP connections.

Despite the web standards backing, SPDY still has a long way to go before it’s an everyday part of the web. With only Chrome and Firefox behind it, SPDY is still only available for about 40 percent of desktop users. But with large services like Twitter throwing their weight behind it, SPDY may well start to take the web by storm — the more websites that embrace SPDY the more likely it is that other browsers will add support for the faster protocol.

If you’d like to follow Twitter’s lead and get your own site serving over SPDY, check out mod_spdy, a SPDY module for the Apache server (currently a beta release).

File Under: APIs, Web Services

Getting Started With Twitter’s Embedded Tweets Feature

Embed a tweet in any webpage

Somewhat lost amidst the news of Twitter’s revamped interface is a slightly more interesting tidbit for web developers: Twitter posts can now be embedded in other pages.

The new Embedded Tweet feature works just like a YouTube movie, offering a short HTML snippet that you can copy and paste into any third-party website. Unfortunately using the Embed Tweet feature from Twitter is somewhat awkward since it’s buried in the new interface. First you need to click on a tweet, then click “details” and then you’ll see the embed option.

The real benefit of the embed feature lies with third party platforms like Twitter’s two launch partners WordPress and Posterous. Users of both services can now simply paste a link to a tweet and it will automatically be converted to an embedded tweet, no cut and paste necessary. For example, just drop this code in your WordPress.com blog and it will automatically be converted to an embedded tweet:

[tweet https://twitter.com/twitterapi/status/133640144317198338]

If you’d like to implement something similar on your own site Twitter now has an OEmbed endpoint you can query to convert Twitter links to embedded tweets. Those not familiar with OEmbed can check out our OEmbed tutorial, but, in a nutshell, OEmbed is a standard format where you send a URL and the host site then sends back the necessary embed code.

There are three steps to Twitter’s OEmbed process:

  1. Obtain an URL to or ID number of the Tweet you want to render.
  2. Make a request to the GET statuses/oembed endpoint, passing the Tweet URL or ID as a query parameter.
  3. Render the html property of the response, as well as a <script> element pointing to //platform.twitter.com/widgets.js, if you want the embed to be interactive.

If you choose to render the tweet using Twitter’s widgets.js, the raw HTML will be converted into an interactive tweet. The fancy embedded tweet script uses Web Intents to allow users to reply, retweet, or follow the user directly from the embedded tweet. See the Twitter developer site for more details on Twitter’s widgets.js and how to use OEmbed to embedded tweets to your website.