From 87dad5ad90d70d896e767d0ee573414269c1b002 Mon Sep 17 00:00:00 2001 From: Steffen Date: Sun, 14 Jun 2020 23:35:06 +0200 Subject: [PATCH] Update Readme --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 5124759..3a7dc87 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ # 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](https://developer.twitter.com/). + +## 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('https://www.url.com/' [, true])) + return $this->parse... + return false; +} +``` +* Currently available parser functions for JSON and RegEx: + * ```parse_json(string)``` + * ```parse(string)``` + +[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WYQZCVJPVSS5L&source=url) \ No newline at end of file