dsp77 Posted March 5, 2014 Report Posted March 5, 2014 <?phpfunction image_upload($image, $status){ require ('tmhOAuth.php'); //https://github.com/themattharris/tmhOAuth $tmhOAuth = new tmhOAuth(array( 'consumer_key' => "sfdgdsgsdfg", 'consumer_secret' => "dsfgdsfgdsfgsd", 'user_token' => "sdfsdfsdf", 'user_secret' => "fgdgdfgdf", )); $code = $tmhOAuth->request( 'POST','https://api.twitter.com/1.1/statuses/update_with_media.json', array( 'media[]' => "@{$image};type=image/jpeg;filename={$image}", 'status' => $status, ), true, // use auth true // multipart ); return $code;}echo image_upload('/var/www/crawl/img/62845745.jpg','Postat prin API');?>1. creati o aplicatie in twitter developer si adaugati tokenurile2. rulati functia image_upload('calea/absoluta/a/pozei','Postat prin API');3. il puteti cupla cu cel de facebook4. adaugati in cron Quote