Patch Notification Robot: Providing you the latest update notifications. https://www.patchbot.de
Find a file
2021-04-07 11:44:29 +02:00
.github Add GitHub funding file 2021-01-26 17:31:35 +01:00
modules Add OpenSCAD 2021-03-29 09:23:09 +02:00
modules_test Import source 2019-07-15 22:27:48 +02:00
twitter-php@450baa2fd7 Update submodule twitter-php to v4.1.2 2020-07-25 15:43:21 +02:00
.gitignore Don't track database and timestamp files in repo 2020-05-01 15:07:47 +02:00
.gitmodules Add Twitter for PHP 2019-12-01 18:17:21 +01:00
Database.php Sort objects by timestamp 2020-04-05 10:59:00 +02:00
db.json.example Rename empty example database file 2021-01-19 16:53:23 +01:00
HostOption.php Site-specific HTTP header fields, e.g. GitHub authentication 2021-01-14 22:30:40 +01:00
LICENSE Update license file only 2021-01-28 15:45:40 +01:00
PatchBase.php PatchBase: dirty adaptation of json parser for yaml files 2021-04-07 11:44:29 +02:00
PatchCollector.php Format console output 2021-01-17 23:22:47 +01:00
PatchCollector_test.php Test driver modified 2020-12-30 00:24:09 +01:00
PatchFeeder.php PatchFeeder: fix newline 2021-03-22 12:08:23 +01:00
PatchObject.php Add XCA 2021-01-30 16:22:11 +01:00
PatchTwitter.php Load renamed include file 2021-01-18 12:37:08 +01:00
PatchViewer.php PatchViewer: fix newline 2021-03-22 10:03:19 +01:00
README.md Separate fetch and fetch_json helper funcs 2021-02-21 18:57:10 +01:00
TwitterKey.php Rename Twitter secrets include file 2021-01-17 13:06:41 +01:00

PatchBot

Patch Notification Robot: Providing you the latest update notifications.

Installation

Run periodically php PatchCollector.php to collect the latest product versions from vendor websites. Limit requests, so web servers will not overload. For data export to webpage, RSS feed and Twitter use output of PatchViewer.php, PatchFeeder.php or PatchTwitter.php. Twitter requires a separate developer registration.

Writing web scraper

  • Inherit from PatchBase base class:
class MyProgram extends PatchBase {
	function __construct() {
		parent::__construct('Vendor', 'Product', 'https://www.vendor.com/product/');
		[$this->patch->setBranch('Branch');]
	}
	...
}
  • Implement check() method to extract version information from website using this template:
function check() : bool {
	if ($this->fetch[_json]('https://www.url.com/'))
		return $this->parse...
	return false;
}
  • Currently available parser functions for JSON and RegEx:
    • parse_json(string)
    • parse(string)

Donate