APIs Tutorials
JavaScript CDN Fallbacks
CDNs are great for pulling shared resources from, especially JavaScript libraries. The advantage in the likelihood that a file is already cached before the user gets to our site is huge. The only problem with using a CDN is that it's out of control; more specifically, what if the CDN server is down? What a nightmare! Thousands if not millions of websites would be hurt...but not yours. Nope, you added a CDN fallback so that a failed CDN wouldn't hurt your site!
XBox Live Gamer API
I've thought long and hard about this, and I still can't decide whether or not I should consider myself a "gamer." During my lifetime, I've owned an original Nintendo, Sega Genesis, Nintendo64 (best controller of any console ever), wii, and XBox 360. I used to have a horrible habit of downloading pirating games, but that's long and over with. Anyways, the only game I've played consistently over the past three years is Call of Duty. Which one? Whichever the latest Call of Duty has been most recently released. I don't even care to attempt the story mode; I simply want to log on and shoot each and every one of you I encounter.
Facebook Tooltip HTML and CSS
Facebook recently implemented a new, lighter tooltip. I say the tooltip is lighter because it seems a lot quicker and more elegant than their previous effort. I took a few moments to grab the HTML structure and CSS rules to see how they did it.
Add a Google+1 Badge to Your Website
Google's new Google+ service is taking the development world by storm, and why shouldn't it? It's minimalistic UI, use of cutting edge web techniques, and overall usability make it Google+ one of the more impressive web applications I've seen in quite a while (I was going to say "since Google Wave", but that one didn't end up well, did it?) Google+ allows you to share photos, links, statuses, and much more; consider it a mesh between Twitter and Facebook.
Facebook Open Graph META Tags
It's no secret that Facebook has become a major traffic driver for all types of websites. Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly. And of course there are Facebook "Like" and "Recommend" widgets on every website. One problem I've always found with sharing URLs on Facebook is that you often have no control over the image and description text that accompany the URL. Had I known about Facebook Open Graph API, I would've known the solution to that problem.
Dojo Toolkit API Bookmarklet
You probably know by know that I enjoy using JavaScript-powered bookmarklets to retrieve information. I create a jQuery documentation bookmarklet, a MooTools class sniffer bookmarklet, and a even a bookmarklet to allow you to submit articles to Script & Style. I work extensively with Dojo on a day to day basis so I end up needing to review documentation often. I got tired of using the API's search methods and instead chose to create a bookmarklet to get quick access to what I want.
JSONP with jQuery, MooTools, and Dojo
We all know that the big limitation of AJAX is that cross-domain requests aren't allowed. We also know, however, that we skirt around that rule a bit by using JSONP. JSONP is the process of SCRIPT tag injection, referencing a cross-domain URL and providing a callback function (on your page) that the provider will call so that you can handle the result. Let's take a look at how JSONP is handled with jQuery, MooTools, and the Dojo Toolkit. For our examples, we'll pull tweets from Twitter with the term "Arsenal" in them.
RealTime Stock Quotes with MooTools Request.Stocks and YQL
It goes without saying but MooTools' inheritance pattern allows for creation of small, simple classes that possess immense power. One example of that power is a class that inherits from Request, Request.JSON, and Request.JSONP: Request.Stocks. Created by Enrique Erne, this great MooTools class acts as a wrapper for Request.JSON and Yahoo!'s YQL service. Let me show you how to user Enrique's awesome MooTools JavaScript class!
Translate Content with the Google Translate API and JavaScript
Note: For this tutorial, I'm using version1 of the Google Translate API. A newer REST-based version is available.
Google URL Shortener PHP Class
Google has had a URL shortening domain for quite a while now but it wasn't until recently that Google exposed the URL shortening API to the public. I took a few minutes to review their API and created a very basic GoogleUrlApi class that will shorten long URLs and expand shortened URLs.