StripeAPIChangeLogBridge.php 767 B

1234567891011121314151617181920212223
  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 CACHE_TIMEOUT = 86400; // 24h
  7. const DESCRIPTION = 'Returns the changes made to the stripe.com API';
  8. public function collectData(){
  9. $html = getSimpleHTMLDOM(self::URI)
  10. or returnServerError('No results for Stripe API Changelog');
  11. foreach($html->find('h3') as $change) {
  12. $item = array();
  13. $item['title'] = trim($change->plaintext);
  14. $item['uri'] = self::URI . '#' . $item['title'];
  15. $item['author'] = 'stripe';
  16. $item['content'] = $change->nextSibling()->outertext;
  17. $item['timestamp'] = strtotime($item['title']);
  18. $this->items[] = $item;
  19. }
  20. }
  21. }