Skip to content

Instantly share code, notes, and snippets.

@LucasOliveiraS
Last active August 7, 2018 17:40
Show Gist options
  • Select an option

  • Save LucasOliveiraS/dd130f31991d20b3beaa7b7f9fff4372 to your computer and use it in GitHub Desktop.

Select an option

Save LucasOliveiraS/dd130f31991d20b3beaa7b7f9fff4372 to your computer and use it in GitHub Desktop.
Embeds on Medium
<?php
include_once 'view.php';
include_once 'model.php';
class Controller {
private $url;
public function setUrl($coin) {
$this->url = "https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_INTRADAY&symbol=$coin&market=EUR&apikey=demo";
return $this->url;
}
public function action() {
$modal = new Model();
$m = $modal->getJson();
$update = $m['Meta Data']['7. Last Refreshed'];
$valorBitcoin = $m['Time Series (Digital Currency Intraday)'][$update]['1a. price (EUR)'];
$v = new View($valorBitcoin);
$v->render();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment