/** * {@inheritdoc} */ public function run() { parent::run(); $this->api = new Bag(); $titles = $this->request->url->getDirectory(1); if (!empty($titles)) { $url = clone $this->request->url; $url->setPath('/w/api.php'); $url->setParameter('action', 'query'); $url->setParameter('format', 'json'); $url->setParameter('continue', ''); $url->setParameter('titles', $titles); //extract images $url->setParameter('prop', 'images'); $api = $this->request->createRequest($url); if ($json = $api->getJsonContent()) { $this->api->set('images', $json); } //extract content $url->setParameter('prop', 'extracts'); $url->setParameter('exchars', 1500); $api = $this->request->createRequest($url); if ($json = $api->getJsonContent()) { $this->api->set('extracts', $json); } } }
/** * {@inheritdoc} */ protected function run() { if ($this->request->getHost() === 'gist.github.com') { $this->addProvider('gist', new Api\Gist()); } parent::run(); }
/** * {@inheritdoc} */ public function run() { if ($this->request->match('*/maps/*')) { $this->addProvider('google', new Api\GoogleMaps()); } parent::run(); }
/** * {@inheritdoc} */ public function run() { if ($this->request->getHttpCode() === 429) { $this->addProvider('oembed', new Providers\OEmbed()); return; } parent::run(); }
/** * {@inheritdoc} */ public function run() { parent::run(); $this->api = new Bag(); $api = $this->request->createRequest($this->request->url->getUrl() . '.json'); if ($json = $api->getJsonContent()) { $this->api->set($json); } }
/** * {@inheritdoc} */ public function run() { parent::run(); $this->api = new Bag(); $api = clone $this->request; $api->url->setParameter('output', 'json'); if ($json = $api->getJsonContent()) { $this->api->set($json); } }
/** * {@inheritdoc} */ public function run() { parent::run(); $this->api = new Bag(); if (isset($this->config['soundcloudKey'])) { $api = $this->request->createRequest('http://api.soundcloud.com/resolve.json'); $api->startingUrl->setParameter('client_id', $this->config['soundcloudKey']); $api->startingUrl->setParameter('url', $this->request->url->getUrl()); if ($json = $api->getJsonContent()) { $this->api->set($json); } } }
/** * {@inheritdoc} */ public function run() { parent::run(); $this->api = new Bag(); if ($id = $this->getId($this->request->startingUrl)) { if ($this->config['facebookKey']) { $api = $this->request->createRequest('https://graph.facebook.com/' . $id); $api->startingUrl->setParameter('access_token', $this->config['facebookKey']); if ($json = $api->getJsonContent()) { $this->api->set($json); } } $this->api->set('id', $id); } }
/** * {@inheritdoc} */ public function run() { $this->addProvider('soundcloud', new Api\Soundcloud()); parent::run(); }
/** * {@inheritdoc} */ public function run() { $this->addProvider('archive', new Api\Archive()); parent::run(); }
/** * {@inheritdoc} */ protected function run() { $this->addProvider('wikipedia', new Api\Wikipedia()); parent::run(); }
/** * {@inheritdoc} */ public function run() { $this->addProvider('facebook', new Api\Facebook()); parent::run(); }
/** * {@inheritdoc} */ public function run() { $this->addProvider('imageshack', new Api\Imageshack()); parent::run(); }