Skip to content

Instantly share code, notes, and snippets.

@mvnp mvnp/Meu code !!!
Created Jan 7, 2018

Embed
What would you like to do?
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Cripto extends CI_Controller {
public function __construct(){
parent::__construct();
}
/**
* Buscando criptomedas ...
* @return [type] [description]
*/
public function index(){
$data["linhas"] = $this->getCriptos();
$this->load->view('bootstrap', $data);
}
/**
* Buscando criptos ...
* @return [type] [description]
*/
private function getCriptos(){
$get = curl_init();
curl_setopt($get, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($get, CURLOPT_RETURNTRANSFER, true);
curl_setopt($get, CURLOPT_URL, 'https://api.coinmarketcap.com/v1/ticker/');
$result = curl_exec($get);
curl_close($get);
$string = json_decode($result);
return $string;
}
}
/* End of file cripto.php */
/* Location: ./application/controllers/cripto.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.