am_dot_com

CN20210414

Apr 14th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2.  
  3. require "vendor/autoload.php";
  4. use am\internet\HttpHelper;
  5. //use html2text\html2text;
  6.  
  7. class LeLouvre{
  8.     //const BASE_URL = "https://collections.louvre.fr/en/recherche?typology[0]=3"
  9.     const BASE_URL = "https://collections.louvre.fr/en/recherche?";
  10.  
  11.     private $mHttp; //cliente de HTTP - fará pedidos ao site do museu
  12.  
  13.     public function __construct(){
  14.         //$this->mHttp = new \am\internet\HttpHelper();
  15.         $this->mHttp = new HttpHelper();
  16.     }//__construct
  17.  
  18.     const TYPOLOGY_PAINTINGS = 1;
  19.     const TYPOLOGY_SCULPTURES = 3;
  20.  
  21.     public function getUrlForTypology(
  22.         int $pTypology = self::TYPOLOGY_PAINTINGS,
  23.         int $pPageNumber = 1
  24.     ){
  25.         $ret = self::BASE_URL."typology[$pTypology]&page=$pPageNumber";
  26.         return $ret;
  27.     }//getUrlForTypology
  28.  
  29.  
  30. }//LeLouvre
  31.  
  32. define ("CLOUD", false);
  33.  
  34. $o = new LeLouvre();
  35. echo $o->getUrlForTypology();
Advertisement
Add Comment
Please, Sign In to add comment