2016-06-25 09:57:02 +02: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 20:01:21 +02:00
|
|
|
$this->uri = 'https://stripe.com/docs/upgrades';
|
2016-06-25 09:57:02 +02:00
|
|
|
$this->description = 'Returns the changes made to the stripe.com API';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function collectData(array $param){
|
2016-07-08 19:06:35 +02:00
|
|
|
$html = $this->getSimpleHTMLDOM('https://stripe.com/docs/upgrades')
|
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-06-25 09:57:02 +02:00
|
|
|
$item=new \Item();
|
2016-08-22 18:55:59 +02: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 09:57:02 +02:00
|
|
|
$this->items[]=$item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 86400; // one day
|
|
|
|
}
|
|
|
|
}
|