curl https://example.com/micropub -X POST -d h=entry -d content="Hello World" \ -d photo=http://example.com/foo.jpg -d category=foo -d published=2018-01-01T10:00:00-0800 --- <?php require('vendor/autoload.php'); $xray = new p3k\XRay(); // Read the input as a string to handle both form-encoded and JSON requests $input = file_get_contents('php://input'); // Parse the Micropub request $request = p3k\Micropub\Request::create($input); // Output as an Mf2 array $item = $request->toMf2(); // Turn it into an Mf2 page $mf2 = ['items' => [$item]]; // Process via XRay $parsed = $xray->process(false, $mf2); print_r($parsed['data']); --- Array ( [type] => entry [published] => 2018-01-01T10:00:00-0800 [category] => Array ( [0] => foo ) [photo] => Array ( [0] => http://example.com/foo.jpg ) [content] => Array ( [text] => Hello World ) )
WeChat ID
aaronpk_tv