All posts tagged ‘Twitter’

Twitter Catches the ‘SPDY’ Train

Photo: dark_ghetto28/Flickr

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.

File Under: Social, Web Services

Twitter Adds More Media-Sharing Services to Inline Previews

Twitter now offers inline previews for more services, like the popular Instagram.

Twitter has expanded the integration of third-party services on its website, adding five new photo and video sharing services to the growing list of what shows up as an inline preview.

Among the new services to secure a spot in the ever-expanding Twitterverse is Instagram, the current darling of the Twitter hipsters. The photo-sharing service has managed to build an impressive following even though it’s currently only available as an iOS app. The majority of Instagram fans use Twitter to post links to their artsy photos.

The other new services available as inline previews include videos from Blip.tv, music players from Rdio, slideshows and presentations from SlideShare and photos and videos from Dipdive.

The new inline preview feature, introduced in September’s make-over, shows a preview of an image or a video in the right-hand pane whenever somebody tweets a link to a supported video or photo site. At launch, that was Flickr, Vimeo, TwitPic and YouTube. Along with the inline previews, you also see associated conversations, recent tweets and mini bios of the people mentioned in the tweet. It’s a feature we really like — it takes Twitter beyond the 140 character limit to include photos, videos, maps and all sorts of other rich media.

While we’re happy to see Twitter integrating with more web services, the new web-based preview features highlight just how far behind the website the company’s official mobile apps have fallen. Neither the official Android client nor the iOS Twitter clients support any of the inline previews you’ll find on the web. Twitter’s mobile site doesn’t show them, either. For a richer mobile Twitter, you’ll need to turn to third-party mobile apps.

See Also:

File Under: Social

Bundle a Bunch of Sites Behind One Bit.ly Link

Link shortening service Bit.ly has unveiled a new link bundling feature that allows you to group multiple links — up to 100 — on a single page and share that page with your friends with a single short URL.

If you’ve been looking for a way to share more than one link at a time with your Twitter followers — perhaps links to both sides of an argument, a collection of your favorite restaurants in New York, or collected coverage of some major, earth-shattering news event — a Bit.ly bundle fits the bill.

Link-shortening services such as Bit.ly have seen an explosion in popularity in the past few years thanks to the steady growth of Twitter, Facebook and other services which limit posts to bite-sized bursts of 140 to 420 characters. Bit.ly remains a powerful link-shortening service with over four billion unique URLs shortened. The company also offers some stand-out features like stat-tracking for each link, automatic QR Code generation, some open APIs and support for popular social web technologies like OAuth.

Now that you can wrap multiple links inside a single Bit.ly URL, it becomes even easier to squeeze more info into a single tweet.

If you’re thinking that a page of links would be pretty boring, well, Bit.ly seems to have had the same thought. The company has integrated media previews of images and videos, as well as any titles, descriptions and notes you want to add to your links.

Bit.ly bundles can also function as a group collaborating tool, your friends can comment on your bundles and even build their own based on your starting points. It also makes Bit.ly a more valuable service, rather than just a middleman of necessity standing between a URL and Twitter.

See Also:

File Under: APIs, Identity, Web Services

Connect to Twitter Without OAuth

OAuth is a great way to sidestep the dilemma of having to hand over passwords to third-party sites and apps to access user data. This is the primary reason the authentication method is fast becoming a de riguer part of today’s social APIs.

But while OAuth solves one problem, it creates another — it greatly raises the complexity of simple apps.

We’ve looked at the issue in the past, particularly with regard to Twitter’s transition to OAuth, which broke countless small scripts. The good news is that OAuth 2.0 is less complex than its predecessor and removes much of the headache for small developers. Unfortunately, OAuth 2.0 isn’t widely adopted yet, and it’s not quite ready for prime time.

But there is a solution for Twitter. SuperTweet was created by developer David Beckemeyer. The service sits between your script and Twitter, where it does the heavy lifting of OAuth for you. Even better, you don’t have to hand over your Twitter password to SuperTweet — instead, you create a password on the site, approve SuperTweet to access your Twitter account and then connect your script to SuperTweet.

The service isn’t meant for full-blown apps, nor does it support commercial uses. But for individuals and non-profits without the development resources to make the switch to OAuth 2.0, it can bring those simple Twitter scripts back to life.

Of course using SuperTweet means adding another potential failure point between your script and Twitter, but if you can live with that, using SuperTweet is easier than wading into OAuth’s waters.

See Also: