Patch Notification Robot: Providing you the latest update notifications. https://www.patchbot.de
Find a file
2022-01-31 09:20:48 +01:00
.github Add GitHub funding file 2021-01-26 17:31:35 +01:00
modules Add mdBook 2022-01-31 09:20:48 +01: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 Exclude module dev dir 2021-08-09 10:16:26 +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.example Untrack configuration includes 2021-08-03 15:31:15 +02:00
LICENSE Update license file only 2021-01-28 15:45:40 +01:00
PatchBase.php PatchBase: JSON iterator returns first hit 2021-10-24 00:26:57 +02:00
PatchCollector.php Add shebang to PHP scripts 2021-11-02 11:17:33 +01:00
PatchCollector_test.php Add shebang to PHP scripts 2021-11-02 11:17:33 +01:00
PatchFeeder.php PatchFeeder: use title also for description 2021-12-16 12:39:49 +01:00
PatchObject.php Tidy up version string 2021-06-16 00:05:24 +02:00
PatchTwitter.php Add shebang to PHP scripts 2021-11-02 11:17:33 +01:00
PatchViewer.php Add shebang to PHP scripts 2021-11-02 11:17:33 +01:00
README.md Update readme 2021-10-13 17:10:55 +02:00
TwitterKey.php.example Untrack configuration includes 2021-08-03 15:31:15 +02:00

PatchBot

Patch Notification Robot: Providing you the latest update notifications.

Installation

Remove .example suffix from files and modify configuration to your needs. 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