1 | <?php |
||
25 | class BancaIntesaBrowser |
||
26 | { |
||
27 | const SOURCE = 'http://www.bancaintesa.rs/pocetna.21.html?print=1'; |
||
28 | /** |
||
29 | * @var Client |
||
30 | */ |
||
31 | private $guzzleClient; |
||
32 | |||
33 | /** |
||
34 | * @var CookieJar |
||
35 | */ |
||
36 | private $guzzleCookieJar; |
||
37 | |||
38 | /** |
||
39 | * Get HTML document with rates. |
||
40 | * |
||
41 | * @param \DateTime $date |
||
42 | * @return StreamInterface |
||
43 | */ |
||
44 | 2 | public function getHtmlDocument(\DateTime $date) |
|
45 | { |
||
46 | 2 | return $this->request('POST', array(), array( |
|
47 | 2 | 'day' => $date->format('d'), |
|
48 | 2 | 'month' => $date->format('m'), |
|
49 | 2 | 'year' => $date->format('Y') |
|
50 | )); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Execute HTTP request and get raw body response. |
||
55 | * |
||
56 | * @param string $method HTTP Method. |
||
57 | * @param array $params Params to send with request. |
||
58 | * @return StreamInterface |
||
59 | */ |
||
60 | 2 | private function request($method, array $query = array(), array $params = array()) |
|
72 | |||
73 | /** |
||
74 | * Get Guzzle Client. |
||
75 | * |
||
76 | * @return Client |
||
77 | */ |
||
78 | 2 | private function getGuzzleClient() |
|
86 | |||
87 | /** |
||
88 | * Get Guzzle CookieJar. |
||
89 | * |
||
90 | * @return CookieJar |
||
91 | */ |
||
92 | 2 | private function getGuzzleCookieJar() |
|
100 | } |
||
101 |