In Chapter 7 of Head First HTML5 Programming, we create a JSONP web application called Tweetshirt. We use Twitter JSON data to create a tweet menu, so you can choose a tweet to add to a <canvas> element.
Unfortunately, Twitter has deprecated the public API that allows us to access a user’s timeline of tweets, and replaced it with an API that requires the user of the application accessing the timeline to authenticate first. This means the URL to access the JSON data of a Twitter user’s timeline on page 322 no longer works.
So you can use the example without having to write any complicated server-side code first, we have created a JSONP service that creates “fake tweets”. It behaves just like the old public Twitter API did, and returns an array of tweets, as a call to the callback you provide to the URL:
So if you’re implementing Tweetshirt as you read Head First HTML5 Programming, you can replace the URL on page 322 with the URL above and continue with the example as written in the book.
Web applications that need to access JSON data that requires authentication, such as data on Twitter or Facebook, can authenticate using a standard called OAuth. To learn how to use OAuth to create a server-side program to retrieve tweets and use it with the example in the book, read Using OAuth to access Twitter. OAuth is beyond the scope of Head First HTML5 Programming, but you’re welcome to try it on your own.
Thanks to chethStudios.net for the Tweetshirt icon.
Thanks a lot. Was searching for this all over the internet. Can you also update this on oriely website(erratta section) of head first html5?
Thanks for the update, this was really confusing…
Hey guys, this link appears to be down now. I know this is 5 years later but basically everything in this book has been relevant and up to date at this point in late 2017, so I think it still worth having a relevant link up there to finish off this exercise.
I can only say everything else in this book has been excellent.
Hi Marc, we fixed the link – I hope it works for you now!