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: https://github.com/FabFab/codebird-php
Inspiration: http://foren.activevb.de/forum/webentwicklung/thread-265/beitrag-266/Twitter-OAuth-using-PHP-without/
Use:
\Codebird\Codebird::setConsumerKey(your_key, your_secret); $cb = \Codebird\Codebird::getInstance(); $cb->setToken(your_token, your_token_secret); $cb->setUseCurl(false); $params = array( 'status' => $message ); $reply = $cb->statuses_update($params);
Latest posts by Fab (see all)
- La Horde du Contrevent : review - 13 October 2024
- For Whom the Bells Tolls: review - 4 August 2024
- Self Aware On Air Neon Sign - 8 June 2024