Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id = "ID";
- $password = "PASSWORD";
- $url = "http://top.mail.ru/json/srchlanding?id=$id&action=json&password=$password&pp=50000&rettype=all";
- $data = json_decode(file_get_contents($url));
- $domains = [];
- $se = [];
- foreach($data->elements as $hit):
- $domains[$hit->sign][parse_url($hit->url, PHP_URL_HOST)] += $hit->hits;
- $se[$hit->sign] += $hit->hits;
- endforeach;
- foreach($se as $name => $value):
- echo "<h2>$name = $value</h2>";
- echo "<table>";
- foreach($domains[$name] as $domain => $hits):
- echo "<tr><td><i>$domain</i></td><td><b>$hits</b></td></tr>";
- endforeach;
- echo "</table>";
- endforeach;
Advertisement
Add Comment
Please, Sign In to add comment