O'Reilly logo

CakePHP 1.3 Application Development Cookbook by Mariano Iglesias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a Twitter datasource

In this recipe we will learn how to implement our own datasource by providing a way to read from and post messages to a Twitter account.

Getting ready

We will integrate this datasource with OAuth, which is an authentication mechanism supported by Twitter. To do so, we will use a class named HttpSocketOauth developed by Neil Crookes, which is an extension to CakePHP's own HttpSocket class that adds OAuth support in a clean and elegant way. Download the file named http_socket_oauth.php from the URL http://github.com/neilcrookes/http_socket_oauth/raw/master/http_socket_oauth.php and place it in your app/vendors folder.

There are other ways to communicate with an OAuth provider such as Twitter, most noticeably using the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required