Compare commits
No commits in common. "fef3a414b518a4d1d01fcb1dbc6e8a54144085b9" and "1be98d0dac737203c25517d7f4a126cbf382d645" have entirely different histories.
fef3a414b5
...
1be98d0dac
4 changed files with 3 additions and 24 deletions
|
|
@ -125,11 +125,6 @@ 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);
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ class Freeplane extends PatchBase {
|
|||
parent::__construct('Freeplane Team', 'Freeplane', 'https://docs.freeplane.org/');
|
||||
}
|
||||
function check() : bool {
|
||||
if ($this->fetch('https://www.freeplane.org/info/history/history_en.txt')) {
|
||||
$this->str_extract(1);
|
||||
return $this->parse('/^([\d\.]+)/m');
|
||||
}
|
||||
if ($this->fetch_json('https://sourceforge.net/projects/freeplane/best_release.json'))
|
||||
return $this->parse_json('filename', '/-([\d\.]+[u\d]*)\.[a-z]+$/');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
class NAPS2 extends PatchBase {
|
||||
function __construct() {
|
||||
parent::__construct('NAPS2 Contributors', 'NAPS2', 'https://www.naps2.com/download');
|
||||
}
|
||||
function check() : bool {
|
||||
if ($this->fetch_json('https://api.github.com/repos/cyanfish/naps2/releases/latest'))
|
||||
return $this->parse_json('tag_name');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -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/portal/windows/'))
|
||||
if ($this->fetch('https://www.teamviewer.com/en/download/windows/'))
|
||||
return $this->parse('/<span data-dl-version-label>([\d\.]+)<\/span>/');
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue