2016-06-25 10:57:02 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* StripeAPIChangeLogBridge
|
|
|
|
*
|
|
|
|
* @name Stripe API Changelog Bridge
|
|
|
|
* @description Returns the changes made to the stripe.com API
|
|
|
|
*/
|
|
|
|
class StripeAPIChangeLogBridge extends BridgeAbstract{
|
|
|
|
public function loadMetadatas() {
|
|
|
|
|
|
|
|
$this->maintainer = 'Pierre Mazière';
|
|
|
|
$this->name = 'Stripe API Changelog';
|
2016-08-09 21:01:21 +03:00
|
|
|
$this->uri = 'https://stripe.com/docs/upgrades';
|
2016-06-25 10:57:02 +03:00
|
|
|
$this->description = 'Returns the changes made to the stripe.com API';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function collectData(array $param){
|
2016-07-08 20:06:35 +03:00
|
|
|
$html = $this->getSimpleHTMLDOM('https://stripe.com/docs/upgrades')
|
2016-08-17 15:45:08 +03:00
|
|
|
or $this->returnServerError('No results for Stripe API Changelog');
|
2016-06-25 10:57:02 +03:00
|
|
|
|
|
|
|
|
2016-08-18 11:21:58 +03:00
|
|
|
foreach($html->find('h3') as $change){
|
2016-06-25 10:57:02 +03:00
|
|
|
$item=new \Item();
|
2016-08-22 19:55:59 +03:00
|
|
|
$item['title']=trim($change->plaintext);
|
|
|
|
$item['uri']='https://stripe.com/docs/upgrades#'.$item['title'];
|
|
|
|
$item['author']='stripe';
|
|
|
|
$item['content']=$change->nextSibling()->outertext;
|
|
|
|
$item['timestamp']=strtotime($item['title']);
|
2016-06-25 10:57:02 +03:00
|
|
|
$this->items[]=$item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 86400; // one day
|
|
|
|
}
|
|
|
|
}
|