Posts Tagged ‘Scripts’
Kleiner „Making Of“-Post
Im gestrigen Geburtstagspost gab es einige hübsche Wordclouds zu sehen. Diese Grafiken wurden mit Wordle erstellt. Dafür brauchte ich aber die Rohdaten zu meinen Posts aufgeteilt auf die einzelnen Jahre.
Glücklicherweise hat WordPress eine XML-RPC Schnittstelle, darüber lässt sich relativ einfach ein entsprechendes Script basteln:
wordpress_fetch.pl usage: wordpress_fetch.pl [long options...] wordpress_fetch.pl --help description: this script connects via the XMLRPC API to your WordPress blog, fetches your posts and saves them into the text file '<YEAR>_blog_output.txt'. If textonly is set, then HTML tags and WordPress codes are stripped. You can set the options via the command line or create a JSON config file and point the parameter --config to it. (See config.json_example) options: --blog_url blog url, e.g. 'http://xyz.wordpress.com' [Required] --config Path to command config file --help -h --usage -? Prints this usage information. [Flag] --max_posts number of posts the script should fetch ideally bigger than your post count, to fetch all your posts in one go [Default:"250"; Integer] --password WordPress password [Required] --textonly strip HTML tags and WordPress codes, default is false [Flag] --username WordPress username [Required]
Ein Backup seiner eigenen Daten zu haben ist ja immer empfehlenswert. Wer das Skript nachnutzen oder weiterentwickeln will, kann sich den Quelltext aus dem GitHub-Repository holen.