StripeAPIChangeLogBridge.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * StripeAPIChangeLogBridge
  4. *
  5. * @name Stripe API Changelog Bridge
  6. * @description Returns the changes made to the stripe.com API
  7. */
  8. class StripeAPIChangeLogBridge extends BridgeAbstract{
  9. public function loadMetadatas() {
  10. $this->maintainer = 'Pierre Mazière';
  11. $this->name = 'Stripe API Changelog';
  12. $this->uri = 'https://stripe.com/docs/upgrades';
  13. $this->description = 'Returns the changes made to the stripe.com API';
  14. }
  15. public function collectData(array $param){
  16. $html = $this->getSimpleHTMLDOM('https://stripe.com/docs/upgrades')
  17. or $this->returnServerError('No results for Stripe API Changelog');
  18. foreach($html->find('h3') as $change){
  19. $item=new \Item();
  20. $item['title']=trim($change->plaintext);
  21. $item['uri']='https://stripe.com/docs/upgrades#'.$item['title'];
  22. $item['author']='stripe';
  23. $item['content']=$change->nextSibling()->outertext;
  24. $item['timestamp']=strtotime($item['title']);
  25. $this->items[]=$item;
  26. }
  27. }
  28. public function getCacheDuration(){
  29. return 86400; // one day
  30. }
  31. }