StripeAPIChangeLogBridge.php 833 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class StripeAPIChangeLogBridge extends BridgeAbstract{
  3. const MAINTAINER = 'Pierre Mazière';
  4. const NAME = 'Stripe API Changelog';
  5. const URI = 'https://stripe.com/docs/upgrades';
  6. const DESCRIPTION = 'Returns the changes made to the stripe.com API';
  7. public function collectData(){
  8. $html = $this->getSimpleHTMLDOM(self::URI)
  9. or $this->returnServerError('No results for Stripe API Changelog');
  10. foreach($html->find('h3') as $change){
  11. $item=array();
  12. $item['title']=trim($change->plaintext);
  13. $item['uri']=self::URI.'#'.$item['title'];
  14. $item['author']='stripe';
  15. $item['content']=$change->nextSibling()->outertext;
  16. $item['timestamp']=strtotime($item['title']);
  17. $this->items[]=$item;
  18. }
  19. }
  20. public function getCacheDuration(){
  21. return 86400; // one day
  22. }
  23. }