11 public function __construct($cfg)
16 public static function opts(\Console_CommandLine $optParser)
18 $cmd = $optParser->addCommand('note');
24 'description' => 'Post text',
29 public function run($command)
33 'content' => $command->args['text'],
36 $body = http_build_query($data);
38 $req = new Request($this->cfg->host, $this->cfg);
39 $res = $req->send($body);
40 $postUrl = $res->getHeader('Location');
41 echo "Post created at server\n";