Patch Notification Robot: Providing you the latest update notifications. https://www.patchbot.de
Find a file
2024-11-19 16:32:44 +01:00
.github Add GitHub funding file 2021-01-26 17:31:35 +01:00
MastodonBotPHP@388e6b1be4 Update MastodonBotPHP to v0.1 2022-11-03 11:43:37 +01:00
modules Merge pull request #6 from adlerweb/ChemGes 2024-11-19 16:32:44 +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 Add new timestamp file to ignore list 2022-04-30 01:04:52 +02:00
.gitmodules Add new timestamp file to ignore list 2022-04-30 01:04:52 +02:00
cron.sh cron.sh: disable Twitter updates 2023-06-17 13:48:49 +02: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
MastodonKey.php.example Add Mastodon toot exporter 2022-04-30 01:06:06 +02:00
PatchBase.php Modify user agent to make some websites happy 2024-04-22 18:30:04 +02:00
PatchCollector.php PatchCollector: modify output 2022-09-21 17:49:29 +02:00
PatchCollector_test.php Testdriver outputs json data 2024-06-28 17:50:14 +02:00
PatchFeeder.php PatchFeeder: use title also for description 2021-12-16 12:39:49 +01:00
PatchMastodon.php Add Mastodon toot exporter 2022-04-30 01:06:06 +02:00
PatchObject.php Tidy up version string 2021-06-16 00:05:24 +02:00
PatchTwitter.php PatchTwitter: rename timestamp file 2022-04-30 01:05:30 +02:00
PatchViewer.php PatchViewer: update web link 2024-07-25 21:39:00 +02:00
README.md Update Readme 2023-02-23 17:12:43 +01: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, Mastodon and Twitter use output of PatchViewer.php, PatchFeeder.php, PatchMastodon.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|_yaml]('https://www.url.com/'))
		return $this->parse...
	return false;
}
  • Currently available parser functions for JSON and RegEx:
    • parse_json(string)
    • parse_yaml(string)
    • parse(string)

Donate