Separate fetch and fetch_json helper funcs

This commit is contained in:
Steffen Lange 2021-02-21 18:57:10 +01:00
parent 4a613a0d3b
commit 62a9f6f0c8
56 changed files with 63 additions and 58 deletions

View file

@ -31,10 +31,12 @@ abstract class PatchBase {
if ($ch = curl_init()) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:1.0) Gecko/20200101 Patchbot/1.0');
if ($opt = HostOption::get($host))
curl_setopt($ch, CURLOPT_HTTPHEADER, $opt);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if (!$json)
curl_setopt($ch, CURLOPT_HEADER, true);
if ($opt = HostOption::get($host))
curl_setopt($ch, CURLOPT_HTTPHEADER, $opt);
$str = curl_exec($ch);
curl_close($ch);
if ($str) {
@ -51,6 +53,9 @@ abstract class PatchBase {
}
return false;
}
protected function fetch_json(string $url) : bool {
return $this->fetch($url, true);
}
protected function parse(string $re) : bool {
if ($str = $this->regex_str($re)) {
$this->patch->setVersion($str, true);

View file

@ -19,7 +19,7 @@ class MyProgram extends PatchBase {
* Implement ```check()``` method to extract version information from website using this template:
```
function check() : bool {
if ($this->fetch('https://www.url.com/' [, true]))
if ($this->fetch[_json]('https://www.url.com/'))
return $this->parse...
return false;
}

View file

@ -5,7 +5,7 @@ class Adminer extends PatchBase {
parent::__construct('Jakub Vrána', 'Adminer', 'https://www.adminer.org/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/vrana/adminer/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/vrana/adminer/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -6,7 +6,7 @@ class AdoptOpenJDK11 extends PatchBase {
$this->patch->setBranch('JRE 11');
}
function check() : bool {
if ($this->fetch('https://api.adoptopenjdk.net/v2/info/releases/openjdk11?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64', true))
if ($this->fetch_json('https://api.adoptopenjdk.net/v2/info/releases/openjdk11?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64'))
return $this->parse_json('openjdk_version');
return false;
}

View file

@ -6,7 +6,7 @@ class AdoptOpenJDK15 extends PatchBase {
$this->patch->setBranch('JRE 15');
}
function check() : bool {
if ($this->fetch('https://api.adoptopenjdk.net/v2/info/releases/openjdk15?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64', true))
if ($this->fetch_json('https://api.adoptopenjdk.net/v2/info/releases/openjdk15?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64'))
return $this->parse_json('openjdk_version');
return false;
}

View file

@ -6,7 +6,7 @@ class AdoptOpenJDK8 extends PatchBase {
$this->patch->setBranch('JRE 8');
}
function check() : bool {
if ($this->fetch('https://api.adoptopenjdk.net/v2/info/releases/openjdk8?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64', true))
if ($this->fetch_json('https://api.adoptopenjdk.net/v2/info/releases/openjdk8?release=latest&openjdk_impl=hotspot&type=jre&os=windows&arch=x64'))
return $this->parse_json('openjdk_version');
return false;
}

View file

@ -5,7 +5,7 @@ class Arduino extends PatchBase {
parent::__construct('Arduino AG', 'Arduino IDE', 'https://www.arduino.cc/en/software');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/arduino/Arduino/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/arduino/Arduino/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class BitwardenRust extends PatchBase {
parent::__construct('Daniel García', 'Bitwarden in Rust', 'https://github.com/dani-garcia/bitwarden_rs');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Bludit extends PatchBase {
parent::__construct('Diego Najar', 'Bludit', 'https://www.bludit.com/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/bludit/bludit/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/bludit/bludit/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Bootstrap extends PatchBase {
parent::__construct('Bootstrap Team', 'Bootstrap', 'https://getbootstrap.com/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/twbs/bootstrap/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/twbs/bootstrap/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Borg extends PatchBase {
parent::__construct('Borg Collective', 'BorgBackup', 'https://www.borgbackup.org/releases/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/borgbackup/borg/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/borgbackup/borg/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Caddy extends PatchBase {
parent::__construct('Matthew Holt', 'Caddy', 'https://caddyserver.com/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/caddyserver/caddy/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/caddyserver/caddy/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class CoreDNS extends PatchBase {
parent::__construct('Miek Gieben', 'CoreDNS', 'https://coredns.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/coredns/coredns/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/coredns/coredns/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Croc extends PatchBase {
parent::__construct('Zack', 'croc', 'https://schollz.com/software/croc6');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/schollz/croc/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/schollz/croc/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Ctop extends PatchBase {
parent::__construct('Bradley Cicenas', 'ctop', 'https://ctop.sh/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/bcicen/ctop/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/bcicen/ctop/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class DNSCryptProxy extends PatchBase {
parent::__construct('Frank Denis', 'dnscrypt-proxy', 'https://github.com/DNSCrypt/dnscrypt-proxy');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/DNSCrypt/dnscrypt-proxy/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/DNSCrypt/dnscrypt-proxy/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Darktable extends PatchBase {
parent::__construct('Darktable Team', 'darktable', 'https://www.darktable.org/install/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/darktable-org/darktable/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/darktable-org/darktable/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class DirectoryLister extends PatchBase {
parent::__construct('Chris Kankiewicz', 'Directory Lister', 'https://www.directorylister.com/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/DirectoryLister/DirectoryLister/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/DirectoryLister/DirectoryLister/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Drone extends PatchBase {
parent::__construct('Drone.IO', 'Drone', 'https://drone.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/drone/drone/tags', true))
if ($this->fetch_json('https://api.github.com/repos/drone/drone/tags'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class ESPurna extends PatchBase {
parent::__construct('Xose Pérez', 'ESPurna', 'https://github.com/xoseperez/espurna');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/xoseperez/espurna/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/xoseperez/espurna/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class FreeCAD extends PatchBase {
parent::__construct('FreeCAD Team', 'FreeCAD', 'https://www.freecadweb.org/downloads.php');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/FreeCAD/FreeCAD/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/FreeCAD/FreeCAD/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Fscrypt extends PatchBase {
parent::__construct('Joe Richey', 'fscrypt', 'https://github.com/google/fscrypt');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/google/fscrypt/releases', true))
if ($this->fetch_json('https://api.github.com/repos/google/fscrypt/releases'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class GCLog extends PatchBase {
parent::__construct('Steffen Lange', 'Geiger Counter Logger', 'https://www.gclog.de/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/stelas/GCLog/tags', true))
if ($this->fetch_json('https://api.github.com/repos/stelas/GCLog/tags'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class Gitea extends PatchBase {
parent::__construct('Gitea Authors', 'Gitea', 'https://gitea.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/go-gitea/gitea/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/go-gitea/gitea/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Gogs extends PatchBase {
parent::__construct('Gogs Authors', 'Gogs', 'https://gogs.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/gogs/gogs/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/gogs/gogs/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Golinks extends PatchBase {
parent::__construct('James Mills', 'golinks', 'https://prologic.github.io/golinks/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/prologic/golinks/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/prologic/golinks/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Grafana extends PatchBase {
parent::__construct('Grafana Labs', 'Grafana', 'https://grafana.com/grafana/download');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/grafana/grafana/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/grafana/grafana/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class HandBrake extends PatchBase {
parent::__construct('HandBrake Team', 'HandBrake', 'https://handbrake.fr/downloads.php');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/HandBrake/HandBrake/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/HandBrake/HandBrake/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Hugo extends PatchBase {
parent::__construct('Hugo Authors', 'Hugo', 'https://gohugo.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/gohugoio/hugo/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/gohugoio/hugo/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class JDigitalSimulator extends PatchBase {
parent::__construct('Kristian Kraljic', 'JDigitalSimulator', 'https://kra.lc/projects/jdigitalsimulator/download.html');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/kristian/JDigitalSimulator/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/kristian/JDigitalSimulator/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class JQuery extends PatchBase {
parent::__construct('jQuery Foundation', 'jQuery', 'https://jquery.com/download/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/jquery/jquery/tags', true))
if ($this->fetch_json('https://api.github.com/repos/jquery/jquery/tags'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class KeePassXC extends PatchBase {
parent::__construct('KeePassXC Team', 'KeePassXC', 'https://keepassxc.org/download/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/keepassxreboot/keepassxc/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/keepassxreboot/keepassxc/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Kodi extends PatchBase {
parent::__construct('XBMC Foundation', 'Kodi', 'https://kodi.tv/download');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/xbmc/xbmc/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/xbmc/xbmc/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Lazydocker extends PatchBase {
parent::__construct('Jesse Duffield', 'lazydocker', 'https://github.com/jesseduffield/lazydocker');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/jesseduffield/lazydocker/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/jesseduffield/lazydocker/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class MRemoteNG extends PatchBase {
parent::__construct('mRemoteNG Dev Team', 'mRemoteNG', 'https://mremoteng.org/download');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/mRemoteNG/mRemoteNG/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/mRemoteNG/mRemoteNG/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class MySQLWorkbench extends PatchBase {
parent::__construct('Oracle', 'MySQL Workbench', 'https://dev.mysql.com/downloads/workbench/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/mysql/mysql-workbench/tags', true))
if ($this->fetch_json('https://api.github.com/repos/mysql/mysql-workbench/tags'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class OBSStudio extends PatchBase {
parent::__construct('OBS Studio Contributors', 'OBS Studio', 'https://obsproject.com/download');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/obsproject/obs-studio/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/obsproject/obs-studio/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class OSP extends PatchBase {
parent::__construct('Deamos', 'Open Streaming Platform', 'https://openstreamingplatform.com/');
}
function check() : bool {
if ($this->fetch('https://gitlab.com/api/v4/projects/Deamos%2Fflask-nginx-rtmp-manager/releases', true))
if ($this->fetch_json('https://gitlab.com/api/v4/projects/Deamos%2Fflask-nginx-rtmp-manager/releases'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class PhpMyAdmin extends PatchBase {
parent::__construct('phpMyAdmin Contributors', 'phpMyAdmin', 'https://www.phpmyadmin.net/downloads/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class PiHole extends PatchBase {
parent::__construct('Pi-hole LLC', 'Pi-hole', 'https://pi-hole.net/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/pi-hole/pi-hole/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/pi-hole/pi-hole/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Prometheus extends PatchBase {
parent::__construct('Prometheus Authors', 'Prometheus', 'https://prometheus.io/download/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/prometheus/prometheus/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/prometheus/prometheus/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Restic extends PatchBase {
parent::__construct('Alexander Neumann', 'restic', 'https://restic.net/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/restic/restic/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/restic/restic/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class RuuviPrometheus extends PatchBase {
parent::__construct('Joonas Kuorilehto', 'ruuvi-prometheus', 'https://github.com/joneskoo/ruuvi-prometheus');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/joneskoo/ruuvi-prometheus/tags', true))
if ($this->fetch_json('https://api.github.com/repos/joneskoo/ruuvi-prometheus/tags'))
return $this->parse_json('name');
return false;
}

View file

@ -5,7 +5,7 @@ class RuuviTag extends PatchBase {
parent::__construct('Ruuvi Innovations', 'RuuviTag', 'https://lab.ruuvi.com/dfu/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/ruuvi/ruuvitag_fw/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/ruuvi/ruuvitag_fw/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Shiori extends PatchBase {
parent::__construct('Radhi Fadlillah', 'Shiori', 'https://github.com/go-shiori/shiori');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/go-shiori/shiori/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/go-shiori/shiori/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Stubby extends PatchBase {
parent::__construct('NLnet Labs', 'Stubby', 'https://dnsprivacy.org/wiki/x/JYAT');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/getdnsapi/stubby/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/getdnsapi/stubby/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Syncthing extends PatchBase {
parent::__construct('Syncthing Foundation', 'Syncthing', 'https://syncthing.net/downloads/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/syncthing/syncthing/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/syncthing/syncthing/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Tasmota extends PatchBase {
parent::__construct('Theo Arends', 'Tasmota', 'https://github.com/arendst/Tasmota');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/arendst/Tasmota/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/arendst/Tasmota/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class TigerVNC extends PatchBase {
parent::__construct('TigerVNC Team', 'TigerVNC', 'https://tigervnc.org/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/TigerVNC/tigervnc/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/TigerVNC/tigervnc/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Tiled extends PatchBase {
parent::__construct('Thorbjørn Lindeijer', 'Tiled Map Editor', 'https://www.mapeditor.org/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/bjorn/tiled/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/bjorn/tiled/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class Traefik extends PatchBase {
parent::__construct('Containous', 'Traefik', 'https://traefik.io/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/containous/traefik/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/containous/traefik/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -6,7 +6,7 @@ class TreeSheets extends PatchBase {
$this->patch->setBranch('Continuous');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/aardappel/treesheets/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/aardappel/treesheets/releases/latest'))
return $this->parse_json('target_commitish', '/(.{7})/');
return false;
}

View file

@ -5,7 +5,7 @@ class TurboVNC extends PatchBase {
parent::__construct('D. R. Commander', 'TurboVNC', 'https://www.turbovnc.org/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/TurboVNC/turbovnc/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/TurboVNC/turbovnc/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class WinMerge extends PatchBase {
parent::__construct('WinMerge Development Team', 'WinMerge', 'https://winmerge.org/downloads/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/winmerge/winmerge/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/winmerge/winmerge/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class XCA extends PatchBase {
parent::__construct('Christian Hohnstädt', 'XCA', 'https://hohnstaedt.de/xca/index.php/download');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/chris2511/xca/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/chris2511/xca/releases/latest'))
return $this->parse_json('tag_name');
return false;
}

View file

@ -5,7 +5,7 @@ class YoutubeDL extends PatchBase {
parent::__construct('youtube-dl Authors', 'youtube-dl', 'https://yt-dl.org/');
}
function check() : bool {
if ($this->fetch('https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest', true))
if ($this->fetch_json('https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest'))
return $this->parse_json('tag_name');
return false;
}