DansTonChatBridge.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * RssBridgeDansTonChat
  4. * Retrieve lastest quotes from DansTonChat.
  5. * Returns the most recent quotes, sorting by date (most recent first).
  6. *
  7. * @name DansTonChat Bridge
  8. * @description Returns latest quotes from DansTonChat.
  9. * @maintainer Astalaseven
  10. */
  11. class DansTonChatBridge extends BridgeAbstract{
  12. public function collectData(array $param){
  13. $html = '';
  14. $link = 'http://danstonchat.com/latest.html';
  15. $html = file_get_html($link) or $this->returnError('Could not request DansTonChat.', 404);
  16. foreach($html->find('div.item') as $element) {
  17. $item = new \Item();
  18. $item->uri = $element->find('a', 0)->href;
  19. $item->title = 'DansTonChat '.$element->find('a', 1)->plaintext;
  20. $item->content = $element->find('a', 0)->innertext;
  21. $this->items[] = $item;
  22. }
  23. }
  24. public function getName(){
  25. return 'DansTonChat';
  26. }
  27. public function getURI(){
  28. return 'http://danstonchat.com';
  29. }
  30. public function getCacheDuration(){
  31. return 21600; // 6 hours
  32. }
  33. }