ensure # on homepage is a #

This commit is contained in:
Jeremy Kauffman 2016-04-09 16:32:41 -04:00
parent 99df9a18ec
commit b7b9b42c99

View file

@ -21,7 +21,9 @@ class CreditApi
{
$rawJSON = file_get_contents('https://spreadsheets.google.com/feeds/cells/1iOC1o5jq_4ySwRzsy2tZPPltw6Tbky2e3lDFdsWV8dU/okf1n52/public/full/R1C1?alt=json');
$json = $rawJSON ? json_decode($rawJSON, true) : [];
return isset($json['entry']) && isset($json['entry']['content']) ? $json['entry']['content']['$t'] : -1;
return isset($json['entry']) && isset($json['entry']['content']) && is_numeric($json['entry']['content']['$t'] ) ?
$json['entry']['content']['$t'] :
6687; //fallback #
}
public static function getCreditsPerDollar($days)