2016-06-25 09:57:02 +02:00
|
|
|
<?php
|
|
|
|
class StripeAPIChangeLogBridge extends BridgeAbstract{
|
2016-08-30 11:23:55 +02:00
|
|
|
const MAINTAINER = 'Pierre Mazière';
|
|
|
|
const NAME = 'Stripe API Changelog';
|
|
|
|
const URI = 'https://stripe.com/docs/upgrades';
|
2016-09-25 17:04:28 +02:00
|
|
|
const CACHE_TIMEOUT = 86400; // 24h
|
2016-08-30 11:23:55 +02:00
|
|
|
const DESCRIPTION = 'Returns the changes made to the stripe.com API';
|
2016-06-25 09:57:02 +02:00
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
2016-08-30 11:23:55 +02:00
|
|
|
$html = $this->getSimpleHTMLDOM(self::URI)
|
2016-08-17 14:45:08 +02:00
|
|
|
or $this->returnServerError('No results for Stripe API Changelog');
|
2016-06-25 09:57:02 +02:00
|
|
|
|
|
|
|
|
2016-08-18 10:21:58 +02:00
|
|
|
foreach($html->find('h3') as $change){
|
2016-08-28 10:41:24 +02:00
|
|
|
$item=array();
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['title']=trim($change->plaintext);
|
2016-08-30 11:23:55 +02:00
|
|
|
$item['uri']=self::URI.'#'.$item['title'];
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['author']='stripe';
|
|
|
|
$item['content']=$change->nextSibling()->outertext;
|
|
|
|
$item['timestamp']=strtotime($item['title']);
|
2016-06-25 09:57:02 +02:00
|
|
|
$this->items[]=$item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|