public function getUrl($url, $name = false)
{
if (!$name) {
$name = rand(1, 4512312).rand(5342, 1231313);
}
$this->client->get($url);
$ali_url = $this->client->getUrl();
$temp = json_encode(array("format" => "1","isAllow" => 0,"link" => $ali_url,"desc" => $name,"image" => "","rejectChange" => false,"expiration_time" => "","no_affiliate_direct" => true,"lang" => null,"selected_banners"=> array(),"size" => "300x250","offer_type" => "ali"));
$create_url = 'https://epn.bz/ru/creative/create';
$res = $this->client->post($create_url, $temp, true);
$list_url = 'https://epn.bz/ru/creative/list';
$list_temp = '{"page":1,"pagebase":"#/creative/tab/list","description":""}';
$result = json_decode($this->client->post($list_url, $list_temp), true);
foreach ($result as $creatives) {
foreach ($creatives as $creative) {
if (!array_key_exists('description', $creative)) {
continue;
}
if ($creative['description'] == $name) {
return $creative['code'];
}
}
}
return false;
}