auto post sur twitter en php

réf : http://www.pontikis.net/blog/auto_post_on_twitter_with_php   récupérer la libraire twitter : https://github.com/jublonet/codebird-php   Post single tweet using php // require codebird require_once(‘/path/to/codebird_php_v2.4.1/codebird.php’); \Codebird\Codebird::setConsumerKey(“your_ConsumerKey”, “your_ConsumerSecret”); $cb = \Codebird\Codebird::getInstance(); $cb->setToken(“your_AccessToken”, “your_AccessTokenSecret”); $params = array(   ‘status’ => ‘Auto Post on Twitter with PHP http://goo.gl/OZHaQD #php #twitter’ ); $reply = $cb->statuses_update($params); Post tweet with image using PHP // require codebird require_once(‘/path/to/codebird_php_v2.4.1/codebird.php’);…

Details

déterminer la taille optimale pour un redimensionnement d’image

la solution en objet est ici : http://www.jarrodoberto.com/articles/2011/09/image-resizing-made-easy-with-php la version procédurale que j’ai réécrite ici bas : <?php function getSizeByFixedHeight($width, $height, $newHeight) { $ratio = $width / $height; $newWidth = round($newHeight * $ratio); return $newWidth; } function getSizeByFixedWidth($width, $height, $newWidth) { $ratio = $height / $width; $newHeight = round($newWidth * $ratio); return $newHeight; } function…

Details