PHP components library
mkdir my-test-project cd my-test-project curl -s http://getcomposer.org/installer | php php composer.phar init -n && php composer.phar require cryptocompress/cryptocompress:dev-master
php composer.phar update
vi weather.php && php weather.php
, (*2)
<?php require __DIR__ . '/vendor/autoload.php'; use \CryptoCompress\WebService\Yahoo\Weather, \CryptoCompress\Http\Curl\Pool; $config = array('url' => 'http://weather.yahooapis.com/forecastrss', 'degree' => Weather::DEGREE_CELSIUS); $weather = new Weather($config, new Pool()); var_dump($weather->getByCode(Weather::CODE_MUNICH)->current());
vi tweet.php && php tweet.php
, (*3)
<?php require __DIR__ . '/vendor/autoload.php'; $con = new \CryptoCompress\Http\Curl\Connection(); echo $con->getDocument('http://twitter.com/CryptoCompress') ->getElementsByTagName('p')->item(3)->textContent;