diff --git a/PatchBase.php b/PatchBase.php index cec2b9d..5e517ef 100644 --- a/PatchBase.php +++ b/PatchBase.php @@ -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); diff --git a/README.md b/README.md index 3a7dc87..ea2d5e6 100644 --- a/README.md +++ b/README.md @@ -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; } @@ -28,4 +28,4 @@ function check() : bool { * ```parse_json(string)``` * ```parse(string)``` -[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WYQZCVJPVSS5L&source=url) \ No newline at end of file +[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WYQZCVJPVSS5L&source=url) diff --git a/modules/Adminer.php b/modules/Adminer.php index 3be5218..d43e41c 100644 --- a/modules/Adminer.php +++ b/modules/Adminer.php @@ -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; } diff --git a/modules/AdoptOpenJDK11.php b/modules/AdoptOpenJDK11.php index c1019a4..895f2be 100644 --- a/modules/AdoptOpenJDK11.php +++ b/modules/AdoptOpenJDK11.php @@ -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; } diff --git a/modules/AdoptOpenJDK15.php b/modules/AdoptOpenJDK15.php index 45b990a..200cd06 100644 --- a/modules/AdoptOpenJDK15.php +++ b/modules/AdoptOpenJDK15.php @@ -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; } diff --git a/modules/AdoptOpenJDK8.php b/modules/AdoptOpenJDK8.php index abccb36..c70858f 100644 --- a/modules/AdoptOpenJDK8.php +++ b/modules/AdoptOpenJDK8.php @@ -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; } diff --git a/modules/Arduino.php b/modules/Arduino.php index 284cfdc..14c42cb 100644 --- a/modules/Arduino.php +++ b/modules/Arduino.php @@ -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; } diff --git a/modules/BitwardenRust.php b/modules/BitwardenRust.php index 197b94c..9af4d2a 100644 --- a/modules/BitwardenRust.php +++ b/modules/BitwardenRust.php @@ -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; } diff --git a/modules/Bludit.php b/modules/Bludit.php index 9c539be..79808f0 100644 --- a/modules/Bludit.php +++ b/modules/Bludit.php @@ -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; } diff --git a/modules/Bootstrap.php b/modules/Bootstrap.php index a37fac7..a833ecf 100644 --- a/modules/Bootstrap.php +++ b/modules/Bootstrap.php @@ -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; } diff --git a/modules/Borg.php b/modules/Borg.php index c8c4aea..5cae2ae 100644 --- a/modules/Borg.php +++ b/modules/Borg.php @@ -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; } diff --git a/modules/Caddy.php b/modules/Caddy.php index 4c8219c..da757ea 100644 --- a/modules/Caddy.php +++ b/modules/Caddy.php @@ -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; } diff --git a/modules/CoreDNS.php b/modules/CoreDNS.php index 1b98200..9c80946 100644 --- a/modules/CoreDNS.php +++ b/modules/CoreDNS.php @@ -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; } diff --git a/modules/Croc.php b/modules/Croc.php index 530cdb2..c1d3727 100644 --- a/modules/Croc.php +++ b/modules/Croc.php @@ -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; } diff --git a/modules/Ctop.php b/modules/Ctop.php index 4617954..c634ef8 100644 --- a/modules/Ctop.php +++ b/modules/Ctop.php @@ -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; } diff --git a/modules/DNSCryptProxy.php b/modules/DNSCryptProxy.php index 809b309..8ee56f0 100644 --- a/modules/DNSCryptProxy.php +++ b/modules/DNSCryptProxy.php @@ -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; } diff --git a/modules/Darktable.php b/modules/Darktable.php index 363ea61..8a66362 100644 --- a/modules/Darktable.php +++ b/modules/Darktable.php @@ -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; } diff --git a/modules/DirectoryLister.php b/modules/DirectoryLister.php index c849ed8..07304f5 100644 --- a/modules/DirectoryLister.php +++ b/modules/DirectoryLister.php @@ -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; } diff --git a/modules/Drone.php b/modules/Drone.php index 4f4f96e..ad229eb 100644 --- a/modules/Drone.php +++ b/modules/Drone.php @@ -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; } diff --git a/modules/ESPurna.php b/modules/ESPurna.php index 1f51b66..e3d4cc1 100644 --- a/modules/ESPurna.php +++ b/modules/ESPurna.php @@ -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; } diff --git a/modules/FreeCAD.php b/modules/FreeCAD.php index 8cc52bd..4d4d9ca 100644 --- a/modules/FreeCAD.php +++ b/modules/FreeCAD.php @@ -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; } diff --git a/modules/Fscrypt.php b/modules/Fscrypt.php index 591499c..f3b9673 100644 --- a/modules/Fscrypt.php +++ b/modules/Fscrypt.php @@ -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; } diff --git a/modules/GCLog.php b/modules/GCLog.php index 17cf487..858ed9f 100644 --- a/modules/GCLog.php +++ b/modules/GCLog.php @@ -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; } diff --git a/modules/Gitea.php b/modules/Gitea.php index a5e8abe..4ac7966 100644 --- a/modules/Gitea.php +++ b/modules/Gitea.php @@ -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; } diff --git a/modules/Gogs.php b/modules/Gogs.php index 6c54c83..f058fe0 100644 --- a/modules/Gogs.php +++ b/modules/Gogs.php @@ -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; } diff --git a/modules/Golinks.php b/modules/Golinks.php index f0b2168..786473a 100644 --- a/modules/Golinks.php +++ b/modules/Golinks.php @@ -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; } diff --git a/modules/Grafana.php b/modules/Grafana.php index dcb7640..c7a5029 100644 --- a/modules/Grafana.php +++ b/modules/Grafana.php @@ -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; } diff --git a/modules/HandBrake.php b/modules/HandBrake.php index 25422b5..85fcae4 100644 --- a/modules/HandBrake.php +++ b/modules/HandBrake.php @@ -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; } diff --git a/modules/Hugo.php b/modules/Hugo.php index aa53930..b78f88c 100644 --- a/modules/Hugo.php +++ b/modules/Hugo.php @@ -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; } diff --git a/modules/JDigitalSimulator.php b/modules/JDigitalSimulator.php index 4a13d29..8719039 100644 --- a/modules/JDigitalSimulator.php +++ b/modules/JDigitalSimulator.php @@ -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; } diff --git a/modules/JQuery.php b/modules/JQuery.php index 48e4446..b019df3 100644 --- a/modules/JQuery.php +++ b/modules/JQuery.php @@ -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; } diff --git a/modules/KeePassXC.php b/modules/KeePassXC.php index 9f1b3e5..8271139 100644 --- a/modules/KeePassXC.php +++ b/modules/KeePassXC.php @@ -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; } diff --git a/modules/Kodi.php b/modules/Kodi.php index 729daa8..cbb39a6 100644 --- a/modules/Kodi.php +++ b/modules/Kodi.php @@ -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; } diff --git a/modules/Lazydocker.php b/modules/Lazydocker.php index 25f3c82..faae115 100644 --- a/modules/Lazydocker.php +++ b/modules/Lazydocker.php @@ -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; } diff --git a/modules/MRemoteNG.php b/modules/MRemoteNG.php index a8bba62..6425a1a 100644 --- a/modules/MRemoteNG.php +++ b/modules/MRemoteNG.php @@ -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; } diff --git a/modules/MySQLWorkbench.php b/modules/MySQLWorkbench.php index 250c370..aa17610 100644 --- a/modules/MySQLWorkbench.php +++ b/modules/MySQLWorkbench.php @@ -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; } diff --git a/modules/OBSStudio.php b/modules/OBSStudio.php index 4ee236a..f7869e5 100644 --- a/modules/OBSStudio.php +++ b/modules/OBSStudio.php @@ -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; } diff --git a/modules/OSP.php b/modules/OSP.php index 07f7b8e..d9532db 100644 --- a/modules/OSP.php +++ b/modules/OSP.php @@ -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; } diff --git a/modules/PhpMyAdmin.php b/modules/PhpMyAdmin.php index 3ceb7c2..5da9b97 100644 --- a/modules/PhpMyAdmin.php +++ b/modules/PhpMyAdmin.php @@ -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; } diff --git a/modules/PiHole.php b/modules/PiHole.php index ecad9d2..3dff1af 100644 --- a/modules/PiHole.php +++ b/modules/PiHole.php @@ -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; } diff --git a/modules/Prometheus.php b/modules/Prometheus.php index ef7399c..07298ae 100644 --- a/modules/Prometheus.php +++ b/modules/Prometheus.php @@ -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; } diff --git a/modules/Restic.php b/modules/Restic.php index 7d4306a..a1b16ff 100644 --- a/modules/Restic.php +++ b/modules/Restic.php @@ -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; } diff --git a/modules/RuuviPrometheus.php b/modules/RuuviPrometheus.php index aec88fa..eeccae1 100644 --- a/modules/RuuviPrometheus.php +++ b/modules/RuuviPrometheus.php @@ -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; } diff --git a/modules/RuuviTag.php b/modules/RuuviTag.php index 891e560..6e22753 100644 --- a/modules/RuuviTag.php +++ b/modules/RuuviTag.php @@ -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; } diff --git a/modules/Shiori.php b/modules/Shiori.php index 66a9a86..1d7bc10 100644 --- a/modules/Shiori.php +++ b/modules/Shiori.php @@ -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; } diff --git a/modules/Stubby.php b/modules/Stubby.php index 9a48b1f..1fae6e4 100644 --- a/modules/Stubby.php +++ b/modules/Stubby.php @@ -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; } diff --git a/modules/Syncthing.php b/modules/Syncthing.php index 5053376..f5851f0 100644 --- a/modules/Syncthing.php +++ b/modules/Syncthing.php @@ -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; } diff --git a/modules/Tasmota.php b/modules/Tasmota.php index c1ca94e..8820cb8 100644 --- a/modules/Tasmota.php +++ b/modules/Tasmota.php @@ -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; } diff --git a/modules/TigerVNC.php b/modules/TigerVNC.php index 9d1f38b..4fe0e4b 100644 --- a/modules/TigerVNC.php +++ b/modules/TigerVNC.php @@ -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; } diff --git a/modules/Tiled.php b/modules/Tiled.php index 72762ac..56f92a0 100644 --- a/modules/Tiled.php +++ b/modules/Tiled.php @@ -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; } diff --git a/modules/Traefik.php b/modules/Traefik.php index f9e1bbe..8750e24 100644 --- a/modules/Traefik.php +++ b/modules/Traefik.php @@ -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; } diff --git a/modules/TreeSheets.php b/modules/TreeSheets.php index d30e5d8..232a8da 100644 --- a/modules/TreeSheets.php +++ b/modules/TreeSheets.php @@ -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; } diff --git a/modules/TurboVNC.php b/modules/TurboVNC.php index ea45cdb..ebc61a0 100644 --- a/modules/TurboVNC.php +++ b/modules/TurboVNC.php @@ -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; } diff --git a/modules/WinMerge.php b/modules/WinMerge.php index c461bd9..9d33a0e 100644 --- a/modules/WinMerge.php +++ b/modules/WinMerge.php @@ -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; } diff --git a/modules/XCA.php b/modules/XCA.php index 7b9bae6..27159d9 100644 --- a/modules/XCA.php +++ b/modules/XCA.php @@ -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; } diff --git a/modules/YoutubeDL.php b/modules/YoutubeDL.php index 1a5c97d..e02231a 100644 --- a/modules/YoutubeDL.php +++ b/modules/YoutubeDL.php @@ -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; }