Skip to content

Instantly share code, notes, and snippets.

@soyluismunoz
Last active December 8, 2021 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soyluismunoz/0f62695c2b10d094d4212bce7b5acf52 to your computer and use it in GitHub Desktop.
Save soyluismunoz/0f62695c2b10d094d4212bce7b5acf52 to your computer and use it in GitHub Desktop.
Tasa dólar banco central de Venezuela (bcv)
<?php
use Goutte\Client as Goutte; // you need to download the Goutte library
function getRateFromBcv()
{
$client = new Goutte();
$crawler = $client->request('GET', 'http://www.bcv.org.ve/');
$price_dolar = $crawler->filter('div#dolar div.field-content div.recuadrotsmc div.centrado');
$dolarBcv = $price_dolar->text();
// $dolarBcv = str_replace(",", ".", $dolarBcv); // if you want to change the number format to english enable this line
return $dolarBcv ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment