# WordPress to HFR (forum.hardware.fr) converter ## Still plenty of work to do, really ugly in some places A `flask` route that does the following: - Receive webhooks from WordPress. - Convert the WordPress blogpost's HTML into BBcode. - Post the resulting BBcode to an HFR topic. ## Setup - WordPress must be set up to send the hook `publish_post` with fields `post_content`, `post_name`, and `post_url` to the URL defined by your network setup. Go to [https:///wp-admin](https:///wp-admin) `> Settings > Webhooks`. - This is packaged as a Docker container meant to be used together with the [Letsencrypt nginx proxy companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion). This could easily be adjusted to run on a [GCP Cloud Function](https://cloud.google.com/functions/). WordPress doesn't require `https` so this could also easily run as a standalone service at home without much setup. - Look through source files for extra info. ## What works, what doesn't - Simple HTML tags should all work (note: this is HFR-centric, HFR doesn't support a number of BBcode tags, hence the questionable translation table compared with other BBcode implementations). - The code is ugly in some places and might explode anytime. - Colours are not supported yet. ## Be careful of... - HFR's agressive anti-spam. Possibly a good idea to adjust the code to not post when doing tests, or edit a post (instead of posting). To edit: modify `POST` to `/bdd.php` and pass a `numreponse` arg to `payload` with a post that belongs to you.