From e7e0804d1c378ff44eb5fdf5a9858a67a40929b7 Mon Sep 17 00:00:00 2001 From: Steffen Lange Date: Sun, 11 May 2025 14:02:26 +0200 Subject: [PATCH 1/3] TeamViewer: update url --- modules/TeamViewer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/TeamViewer.php b/modules/TeamViewer.php index f9198a7..b27d896 100644 --- a/modules/TeamViewer.php +++ b/modules/TeamViewer.php @@ -5,7 +5,7 @@ class TeamViewer extends PatchBase { parent::__construct('TeamViewer', 'TeamViewer', 'https://www.teamviewer.com/en/download/windows/'); } function check() : bool { - if ($this->fetch('https://www.teamviewer.com/en/download/windows/')) + if ($this->fetch('https://www.teamviewer.com/en/download/portal/windows/')) return $this->parse('/([\d\.]+)<\/span>/'); return false; } From fe0303bcbb688d94e5bab81880c9b03920722052 Mon Sep 17 00:00:00 2001 From: Steffen Lange Date: Sun, 11 May 2025 14:02:41 +0200 Subject: [PATCH 2/3] Add NAPS2 --- modules/NAPS2.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/NAPS2.php diff --git a/modules/NAPS2.php b/modules/NAPS2.php new file mode 100644 index 0000000..9ad67ae --- /dev/null +++ b/modules/NAPS2.php @@ -0,0 +1,14 @@ +fetch_json('https://api.github.com/repos/cyanfish/naps2/releases/latest')) + return $this->parse_json('tag_name'); + return false; + } +} + +?> From fef3a414b518a4d1d01fcb1dbc6e8a54144085b9 Mon Sep 17 00:00:00 2001 From: Steffen Lange Date: Sun, 11 May 2025 14:03:30 +0200 Subject: [PATCH 3/3] Freeplane: parse changelog file --- PatchBase.php | 5 +++++ modules/Freeplane.php | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/PatchBase.php b/PatchBase.php index 5269e37..2fbfdbd 100644 --- a/PatchBase.php +++ b/PatchBase.php @@ -125,6 +125,11 @@ abstract class PatchBase { $this->data = $str; } } + protected function str_extract(int $n) { + $lines = explode("\r\n", $this->data); + if (count($lines) > $n) + $this->data = $lines[$n]; + } private function curl(string $url, array $opts) { if ($ch = curl_init()) { curl_setopt($ch, CURLOPT_URL, $url); diff --git a/modules/Freeplane.php b/modules/Freeplane.php index 9181e5f..1be5739 100644 --- a/modules/Freeplane.php +++ b/modules/Freeplane.php @@ -5,8 +5,10 @@ class Freeplane extends PatchBase { parent::__construct('Freeplane Team', 'Freeplane', 'https://docs.freeplane.org/'); } function check() : bool { - if ($this->fetch_json('https://sourceforge.net/projects/freeplane/best_release.json')) - return $this->parse_json('filename', '/-([\d\.]+[u\d]*)\.[a-z]+$/'); + if ($this->fetch('https://www.freeplane.org/info/history/history_en.txt')) { + $this->str_extract(1); + return $this->parse('/^([\d\.]+)/m'); + } return false; } }