DemoBridge.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. class DemoBridge extends BridgeAbstract{
  3. public function loadMetadatas() {
  4. $this->maintainer = "teromene";
  5. $this->name = "DemoBridge";
  6. $this->uri = "http://github.com/sebsauvage/rss-bridge";
  7. $this->description = "Bridge used for demos";
  8. $this->update = "2015-11-03";
  9. $this->parameters['testCheckbox'] =
  10. '[
  11. {
  12. "type" : "checkbox",
  13. "identifier" : "testCheckbox",
  14. "name" : "test des checkbox"
  15. }
  16. ]';
  17. $this->parameters['testList'] =
  18. '[
  19. {
  20. "type" : "list",
  21. "identifier" : "testList",
  22. "name" : "test des listes",
  23. "values" : [
  24. {
  25. "name" : "Test",
  26. "value" : "test"
  27. },
  28. {
  29. "name" : "Test 2",
  30. "value" : "test2"
  31. }
  32. ]
  33. }
  34. ]';
  35. $this->parameters['testNumber'] =
  36. '[
  37. {
  38. "type" : "number",
  39. "identifier" : "testNumber",
  40. "name" : "test des numéros",
  41. "exampleValue" : "1515632"
  42. }
  43. ]';
  44. }
  45. public function collectData(array $param){
  46. $item = new \Item();
  47. $item->name = "TestElement";
  48. $item->title = "Test";
  49. $item->content = "Awesome content !";
  50. $item->id = "Lalala";
  51. $item->uri = "http://test.test/test";
  52. $item->enclosures[] = "http://www.ardmediathek.de/ard/servlet/image/00/32/68/18/38/1135274624/16x9/960";
  53. $this->items[] = $item;
  54. }
  55. public function getName() {
  56. return "DemoBridge";
  57. }
  58. public function getURI() {
  59. return "http://github.com/sebsauvage/rss-bridge";
  60. }
  61. public function getCacheDuration(){
  62. return 00; // 1 hour
  63. }
  64. }