function incrementKeyedIssues($keyedIssues) { $states = array('open', 'closed'); $since = $keyedIssues->meta->since; foreach ($states as $state) { $page = 1; $lastPage = $page + 9; while ($page <= $lastPage) { $file = getSSLPage("https://api.github.com/repos/highslide-software/highcharts.com/issues" . "?page={$page}&state={$state}&since={$since}"); $issues = json_decode($file); if (is_array($issues)) { if (sizeof($issues) === 0) { echo "<br/>--- No more {$state} issues ---"; break; } echo "\n<h2>Page: {$state} {$page}</h2>\n"; foreach ($issues as $i => $issue) { echo '#' . $issue->number . ', '; $number = $issue->number; $keyedIssues->issues->{$number} = $issue; } //file_put_contents("pages/$state-$page.json", $file); $page++; } else { if ($issues->message) { echo "<div style='color:red; font-weight: bold'>{$issues->message}</div>\n"; } else { echo "<div style='color:red; font-weight: bold'>Unknown problem</div>\n"; } break; } } } $keyedIssues->meta->since = strftime('%Y-%m-%dT%H:%M:%SZ', mktime()); echo "<br/>Incremented to total " . sizeof($keyedIssues) . " issues."; return $keyedIssues; }
function getPoke() { if (!empty($_SESSION['poke'])) { error_reporting(~0); ini_set('display_errors', 1); strip_tags($_SESSION['poke']); $query = http_build_query(array('updateID' => $_SESSION['poke'])); $url = geoRefLink() . "/SafeGuard_Composition/GetPoke?" . $query; $fileContent = getSSLPage($url); if ($fileContent != '{}') { $jsoninho = json_decode($fileContent); $_SESSION['poke'] = $jsoninho->{'poke'}; $_SESSION['pokeReady'] = 1; } } }
function getBankCardInfo($cardNo) { $getCardInfoUrl = 'https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&cardNo=%s&cardBinCheck=true'; $cardInfo = getSSLPage(sprintf($getCardInfoUrl, $cardNo)); $cardInfo = json_decode($cardInfo); return $cardInfo; }