59 lines
1.6 KiB
PHP
Executable File
59 lines
1.6 KiB
PHP
Executable File
<?php
|
|
namespace App\Services\Github\Mod;
|
|
use App\Services\TomTool\Http;
|
|
|
|
class Base {
|
|
|
|
public $oHttp;
|
|
public $oHuodong; // 没用了
|
|
public $sHuodongStr; // 没用了
|
|
public $aShip;
|
|
public $aArticle;
|
|
|
|
public function __construct()
|
|
{
|
|
|
|
$this->oHttp = new Http();
|
|
|
|
}
|
|
|
|
public function todayUpd()
|
|
{
|
|
|
|
$this->oHttp->sToUrl = env('api_url_freenode_base').'/'.'api/github/todayupd';
|
|
$r = $this->oHttp->send();
|
|
|
|
if (env('is_loc') == 1) {
|
|
return true;
|
|
}
|
|
|
|
if ($r == 1) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
public function getArticleFreenode()
|
|
{
|
|
$this->oHttp->sToUrl = env('api_url_freenode_base').'/'.'api/github/getlast';
|
|
$sFreenodeNow = $this->oHttp->send();
|
|
$aFreenodeNow = json_decode($sFreenodeNow, 1);
|
|
return $aFreenodeNow;
|
|
}
|
|
|
|
public function getFreenodeCountryFromMaster()
|
|
{
|
|
$this->oHttp->sToUrl = "https://".env('www_master').'/api/freenode/country/rand';
|
|
$sFreenodeCountry = $this->oHttp->send();
|
|
$aFreenodeCountry = json_decode($sFreenodeCountry, 1);
|
|
|
|
$aData["freenodeCountry"] = $aFreenodeCountry;
|
|
$aData["str"] = date('Y年m月d日').",本次更新共".$aFreenodeCountry["nodeCount"]."个可用节点,最高速度".$aFreenodeCountry["speed"]."M/S。覆盖".implode("、", $aFreenodeCountry["country"])."等多个区域。";
|
|
|
|
return $aData;
|
|
}
|
|
|
|
}
|