Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell:
Twitter Search API Using PHP and Guzzle
Jul 11, 2013 @ 17:49:45

Lorna Mitchell has a new post to her site today showing how she connected to Twitter with Guzzle, the popular PHP-based HTTP client (also used in the Amazon Web Services PHP client).

In case you missed it, Twitter updated their APIs recently, so that you have to authenticate to use even their search APIs to return publicly-available results. This is an increasing trend for API providers, to provide either very limited or nonexistent access for unauthenticated users, I think so they can rate limit consumers that swamp them. To cut a long story short, that meant I needed to update my dashboards that keep an eye on twitter searches to do more than just call file_get_contents in the general direction of the right URL.

She walks you through the creation of the client complete with the OAuth plugin (included with Guzzle) to make an OAuth request to api.twitter.com. With the client created, she shows a simple search call to the "tweets" endpoint.

tagged: twitter search guzzle tutorial http client oauth api

Link: http://www.lornajane.net/posts/2013/twitter-search-api-using-php-and-guzzle


Trending Topics: