Skip to Content
Twitter API: Up and Running
book

Twitter API: Up and Running

by Kevin Makice
March 2009
Beginner to intermediate
414 pages
12h 30m
English
O'Reilly Media, Inc.
Content preview from Twitter API: Up and Running

Chapter 5. Meet the Output

image with no caption

kmakice You give and give and give. Let Twitter return the favor.

In the previous chapter, we looked at all the wonderful ways you can send commands to the Twitter API. Now, what are those commands going to do for you? For starters, Twitter will give you lots of useful data. In this chapter, we’ll take a closer look at the stuff Twitter sends back to you in answer to your requests for data.

The Twitter API supports different formats (.xml, .json, .rss, and .atom), but for this book I will use the custom XML format provided by Twitter (.xml). You could use .json instead, and it would work just as well. One format isn’t appreciably better than the other; they’re just different. It’s a matter of personal choice, and I chose XML.

Note

One exception is with applications using the Search method. The search API returns results using Atom, a particular variation of XML.

XML uses semantic tags to wrap up the data in a way that is easy to extract. The format is useful in separating the data layer from the presentation layer, so the same information can be rendered on a computer or cell phone screen in whatever way works best for that device.

Note

Unless you are specifically looking for the data returned by Twitter, it is better practice to look at the HTTP status code returned from the request. A code of 200 always indicates success. Response objects can and will change, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

The Developer’s Guide to Social Programming: Building Social Context Using Facebook, Google Friend Connect, and the Twitter API

The Developer’s Guide to Social Programming: Building Social Context Using Facebook, Google Friend Connect, and the Twitter API

Mark D. Hawker
Sams Teach Yourself the Twitter API in 24 Hours

Sams Teach Yourself the Twitter API in 24 Hours

Christopher Peri, Ben Ho, Jon Wu, Chia Hwu

Publisher Resources

ISBN: 9780596157777Errata Page