diff options
author | Johannes Schauer <josch@debian.org> | 2017-08-04 22:06:01 +0200 |
---|---|---|
committer | Johannes Schauer <josch@debian.org> | 2017-08-04 22:06:01 +0200 |
commit | b005331cd910c0cc7dee2ddf82491b8248f431cf (patch) | |
tree | ff8b5cbfe81d570b878cb8d60ee51d07c3b1d059 /bridges/StripeAPIChangeLogBridge.php |
Import rss-bridge_2017-08-03.orig.tar.gz
[dgit import orig rss-bridge_2017-08-03.orig.tar.gz]
Diffstat (limited to 'bridges/StripeAPIChangeLogBridge.php')
-rw-r--r-- | bridges/StripeAPIChangeLogBridge.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bridges/StripeAPIChangeLogBridge.php b/bridges/StripeAPIChangeLogBridge.php new file mode 100644 index 0000000..22ef381 --- /dev/null +++ b/bridges/StripeAPIChangeLogBridge.php @@ -0,0 +1,23 @@ +<?php +class StripeAPIChangeLogBridge extends BridgeAbstract { + const MAINTAINER = 'Pierre Mazière'; + const NAME = 'Stripe API Changelog'; + const URI = 'https://stripe.com/docs/upgrades'; + const CACHE_TIMEOUT = 86400; // 24h + const DESCRIPTION = 'Returns the changes made to the stripe.com API'; + + public function collectData(){ + $html = getSimpleHTMLDOM(self::URI) + or returnServerError('No results for Stripe API Changelog'); + + foreach($html->find('h3') as $change) { + $item = array(); + $item['title'] = trim($change->plaintext); + $item['uri'] = self::URI . '#' . $item['title']; + $item['author'] = 'stripe'; + $item['content'] = $change->nextSibling()->outertext; + $item['timestamp'] = strtotime($item['title']); + $this->items[] = $item; + } + } +} |