BooruprojectBridge.php 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. require_once('GelbooruBridge.php');
  3. class BooruprojectBridge extends GelbooruBridge {
  4. const MAINTAINER = 'mitsukarenai';
  5. const NAME = 'Booruproject';
  6. const URI = 'http://booru.org/';
  7. const DESCRIPTION = 'Returns images from given page of booruproject';
  8. const PARAMETERS = array(
  9. 'global' => array(
  10. 'p' => array(
  11. 'name' => 'page',
  12. 'type' => 'number'
  13. ),
  14. 't' => array(
  15. 'name' => 'tags'
  16. )
  17. ),
  18. 'Booru subdomain (subdomain.booru.org)' => array(
  19. 'i' => array(
  20. 'name' => 'Subdomain',
  21. 'required' => true
  22. )
  23. )
  24. );
  25. const PIDBYPAGE = 20;
  26. public function getURI(){
  27. if(!is_null($this->getInput('i'))) {
  28. return 'http://' . $this->getInput('i') . '.booru.org/';
  29. }
  30. return parent::getURI();
  31. }
  32. public function getName(){
  33. if(!is_null($this->getInput('i'))) {
  34. return static::NAME . ' ' . $this->getInput('i');
  35. }
  36. return parent::getName();
  37. }
  38. }