2016-06-25 10:57:02 +03:00
|
|
|
<?php
|
|
|
|
class StripeAPIChangeLogBridge extends BridgeAbstract{
|
2016-08-27 22:03:26 +03:00
|
|
|
public $maintainer = 'Pierre Mazière';
|
|
|
|
public $name = 'Stripe API Changelog';
|
|
|
|
public $uri = 'https://stripe.com/docs/upgrades';
|
|
|
|
public $description = 'Returns the changes made to the stripe.com API';
|
2016-06-25 10:57:02 +03:00
|
|
|
|
2016-08-25 02:24:53 +03:00
|
|
|
public function collectData(){
|
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
|
|
|
|
}
|
|
|
|
}
|