Codebird without cURL

Google Apps Engine doesn’t allow cURL, among lots of other things, like PHP native mail(), we will come back on this another day.

I needed to post a tweet from Google Apps Engine and couldn’t find a library using URL Fetch to do so, in few lines. It seems that everybody is using cURL!

So, I took an existing project: Codebird, a nice PHP class enabling to connect to Twitter API really easily, and added the methods to make file_get_contents() requests, with SSL, instead of using cURL.

Here it is:

Git repository:



\Codebird\Codebird::setConsumerKey(your_key, your_secret);
$cb = \Codebird\Codebird::getInstance();
$cb->setToken(your_token, your_token_secret);
$params = array(
 'status' => $message
$reply = $cb->statuses_update($params);
Latest posts by Fab (see all)

About Fab

Solutions Architect, I build great workflows for the news, media and broadcast industries. I play with data too.

Leave a comment

Your email address will not be published. Required fields are marked *