4 class Command_Like extends Command_AbstractProps
6 public static function opts(\Console_CommandLine $optParser)
8 $cmd = $optParser->addCommand('like');
9 static::optsGeneric($cmd);
14 'description' => 'URL that is liked',
19 public function run(\Console_CommandLine_Result $cmdRes)
21 $url = Validator::url($cmdRes->args['url'], 'url');
26 $req = new Request($this->cfg->host, $this->cfg);
27 $req->setType('entry');
28 $req->addProperty('like-of', $url);
30 $this->handleGenericOptions($cmdRes, $req);
33 $postUrl = $res->getHeader('Location');
34 if ($postUrl === null) {
35 Log::err('Error: Server sent no "Location" header and said:');
36 Log::err($res->getBody());
39 Log::info('Like created at server');