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';
|
2016-08-17 15:45:08 +03:00
|
|
|
$this->update = '2016-08-17';
|
2016-06-25 10:57:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
$item->title=trim($change->plaintext);
|
|
|
|
$item->uri='https://stripe.com/docs/upgrades#'.$item->title;
|
2016-08-09 15:54:44 +03:00
|
|
|
$item->author='stripe';
|
2016-06-25 10:57:02 +03:00
|
|
|
$item->content=$change->nextSibling()->outertext;
|
|
|
|
$item->timestamp=strtotime($item->title);
|
|
|
|
$this->items[]=$item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 86400; // one day
|
|
|
|
}
|
|
|
|
}
|