Sams Teach Yourself the Twitter API in 24 Hours
Christopher Peri
Ben Ho
Jon Wu
Chia Hwu
800 East 96th Street, Indianapolis, Indiana 46240 USA
Sams Teach Yourself the Twitter API in 24 Hours
Copyright 2011 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-33110-7
ISBN-10: 0-672-33110-1
Library of Congress Cataloging-in-Publication Data
Peri, Christopher A., 1964
Sams teach yourself the Twitter API in 24 hours / Christopher A. Peri, Bess P. Ho.
p. cm.
Includes index.
ISBN-13: 978-0-672-33110-7 (pbk. : alk. paper)
ISBN-10: 0-672-33110-1 (pbk. : alk. paper)
1. Application program interfaces (Computer software) 2. Twitter. I. Ho, Bess P.,
1967- II. Title. III. Title: Teach yourself the Twitter API in 24 hours.
QA76.76.A63P47 2011
006.7'54dc23
2011022576
Printed in the United States of America
First Printing June 2011
Associate Publisher
Mark Taub
Signing Editor
Trina MacDonald
Development Editor
Songlin Qiu
Managing Editor
Kristy Hart
Project Editor
Andy Beaster
Copy Editor
Barbara Hacha
Indexer
Erika Millen
Proofreader
Sarah Kearns
Technical Editors
Doug Jones
Ronan Schwartz
Ben Schupak
Publishing Coordinator
Olivia Basegio
Cover Designer
Gary Adair
Composition
Gloria Schurick
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
For sales outside of the U.S., please contact
International Sales
About the Author
Dr. Christopher Peri received his Doctorate from the University of California, Berkeley, in Architecture. His focus was on Collaboration in Virtual Environments delving into methods that facilitate designers and engineers to improve communication over remote networks.
He started playing with the Twitter API very early in the API release, creating his own Twitter client called TwittFilter, which is geared more to the occasional user then someone who uses Twitter all the time. As time went on, he added more and more features and functions for his own personal use, until one day he realized he had a fairly sophisticated application and opened it up to the general public to use. He learned quite a bit about the Twitter API the hard wayby simply coding things up and seeing what happens. Although TwittFilter is still a personal project, he has already created a number of private Twitter applications, robots, and smaller projects like NewsSnacker.com, which is open to the public.
About the Contributing Author
Bess Ho is a UI Engineer in mobile, tablet, TV, and web with a strong background in data analytic and consumer behavior. She received her Master Degree from the University of California, Davis in Food Science and Technology. Her focus was on Consumer Sensory Science and Engineering. She is the winner of Nokia Open Screen Project Fund and was elected as Samsung Star in the Samsung Mobile Innovator worldwide program. She served as technical editor for the book titled Building OpenSocial Apps: A Field Guide to Working with MySpace Platform (Addison Wesley, 2009). She has presented mobile technology at Stanford University, OReilly Web20 Expo SF, Where20 Conference, Silicon Valley China Wireless Conference, and many developer events. Currently, she is Mobile Architect (EIR) for Archimedes Ventures. She also advises many early-stage startups in UI/UXP design and mobile development in multiple platforms. She is actively teaching many mobile classes such as iOS SDK in Silicon Valley and online courses at Udemy.com. You can follow her at Twitter @Bess or Slideshare at www.slideshare.net/bess.ho. Her developer blog is at http://www.bess.co.
Acknowledgments
.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what were doing right, what we could do better, what areas youd like to see us publish in, and any other words of wisdom youre willing to pass our way.
You can email or write me directly to let me know what you did or didnt like about this bookas well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this books title and author as well as your name and phone or email address. I will carefully review your comments and share them with the author and editors who worked on the book.
Email:
Mail: Mark Taub
Associate Publisher
Sams Publishing
800 East 96th Street
Indanapolis, IN 46240 USA
Reader Services
Visit our website and register this book at www.informit.com/title/9780672331107 for convenient access to any updates, downloads, or errata that might be available for this book.
Preface
This book on the Twitter API is geared to the programmer who is just a bit past beginnerwho knows the basics of LAMP, including how to set up a basic server, PHP, JavaScript, HTML, and CSS. You do not have to be an expert programmer to use this book, but you should know how to look things up. In writing this book, we have tried to provide you with everything you need to get a simple Twitter client up and running. We include an hour on setting up your environment, as well as providing you with HTML and CSS codes to have something up and running. However, its beyond the scope of this book to explain what is happening with these codes. Instead, we focus on the code surrounding the API calls, OAuth, and the returns. That does not mean that you could not use this book if you are a beginner programmer. Because we provide you with all the code and build an application up step by step, you can stop at any time and look up parts of the code you do not understand. However, if you have never coded anything before, you may find that this book moves far too fast. It may be better to get an introductory book on basic programming in PHP before reading this book.