lbry.com/lib/thirdparty/LBRY.class.php
Alex Grintsvayg 259b9f33a5 unsubscribe
2017-05-26 13:18:30 -04:00

24 lines
No EOL
552 B
PHP

<?php
class LBRY
{
public static function getApiUrl($endpoint)
{
return Config::get('lbry_api_server') . $endpoint;
}
public static function getLBCtoUSDRate()
{
$response = CurlWithCache::get(static::getApiUrl('/lbc/exchange_rate'), [], [
'cache' => 3600, //one hour
'json_response' => true
]);
return $response['data']['lbc_usd'] ?? 0;
}
public static function unsubscribe($email)
{
return Curl::post(static::getApiUrl('/user_unsubscribe/new'), ['email' => $email], ['json_response' => true]);
}
}