11 public function __construct($cfg)
16 public function run($url)
18 $url = Validator::url($url, 'url');
23 $body = http_build_query(
30 $req = new Request($this->cfg->host, $this->cfg);
31 $res = $req->send($body);
32 $postUrl = $res->getHeader('Location');
33 if ($postUrl === null) {
34 Log::err('Error: Server sent no "Location" header and said:');
35 Log::err($res->getBody());
38 echo "Like created at server\n";