📝 Update WordPress content via the REST API

With the WordPress REST API plugin, use the following curl command line to get and update the title and content. GET a page curl --user "$WPAPPUSER:$WPAPPPASS" -X GET https://website/index.php/wp-json/wp/v2/pages/<page_id> | jq ".content.rendered" Update a title curl --user "$WPAPPUSER:$WPAPPPASS" -X POST https://website/index.php/wp-json/wp/v2/pages/<page_id> -d 'title=My title' Update the content content="<!-- wp:paragraph --><p>Hello World</p><!-- /wp:paragraph -->" curl --user "$WPAPPUSER:$WPAPPPASS" -X POST https://website/index.php/wp-json/wp/v2/pages/<page_id> -d "content=$content"

March 15, 2022 · 1 min · 61 words · ticapix

🎞️ MP4 vs GIF

Spec MP4 GIF File Size 409kB 413kB Resolution 320x240 320x240 FPS 5 0.8 Quality medium (crf=28) low (256 colors) Audio yes no Support HTML5 browser with the good video decoder any browser from the 21st century. Gif ffmpeg -i input.avi -vf scale=320:-1 -r 0.8 -f image2pipe -vcodec ppm - | convert -delay 80 -loop 0 - gif:- | convert -layers Optimize - output.gif (from StackExchange) ...

July 25, 2015 · 1 min · 104 words · ticapix

⚠️ Tornado API docs with Sphinx: pitfalls

I’ve developed a small RESTful service with Tornado and I wanted to generate docs for the exposed API. Lucky me, someone already thought about it and created the sphinxcontrib.autohttp.tornado addon for Sphinx. The next few tips will help getting the work done: If you’re using python-3, you need to use this file tornado.py. The latest release 1.2.1 (as of 30/04/2014) doesn’t work with python-3, because methods = inspect.getmembers(handler, predicate=inspect.ismethod) # returns an empty array with python-3 The predicate needs to be changed to include ismethod or isfunction. ...

April 30, 2014 · 1 min · 140 words · ticapix