https://github.com/ricardozanini/camel-example-wordpress
A camel-wordpress example to generate reports based on soccer stats API
https://github.com/ricardozanini/camel-example-wordpress
Last synced: 8 months ago
JSON representation
A camel-wordpress example to generate reports based on soccer stats API
- Host: GitHub
- URL: https://github.com/ricardozanini/camel-example-wordpress
- Owner: ricardozanini
- License: apache-2.0
- Created: 2018-04-02T22:59:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-05T14:43:07.000Z (about 1 year ago)
- Last Synced: 2025-02-07T02:51:13.359Z (8 months ago)
- Language: Java
- Size: 1.57 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Apache Camel Wordpress Example
This is a simple example scenario of how to use the [camel-wordpress](https://github.com/apache/camel/blob/master/components/camel-wordpress/src/main/docs/wordpress-component.adoc) component.
In this example, we see how to use this component to publish an auto generated news post based on a [soccer statistics API](https://www.football-data.org/). The example consumes the statistics API, generates the text based on a [Natural Language Generation (NLG) library](https://github.com/simplenlg/simplenlg) and them publishes it to the Wordpress blog.
## How to use
If you have an OpenShift installation, just add the template to your project and create a new app based on it:
```shell
git clone git@github.com:ricardozanini/camel-example-wordpress.gitoc create -f openshift/camel-wordpress-sample-template.yaml
```If you do not, just edit the `src/main/resources/application.properties` file with your environment vars and try it out with a simple HTTP GET to get a summary of a certain match:
```shell
curl http://localhost:8080/api/match/158186/summary
```To send this summary to a Wordpress blog post just:
```shell
curl http://localhost:8080/api/match/158186/send
```### Wordpress installation steps
If you use the OpenShift template, you have to follow these steps to get everything working:
1. Open Wordpress and finish the installation by adding the same user informed during the project creation
2. Login at Wordpress dashboard and activate the `Basic Auth Plugin`
3. Update the **Permalink** options to enable the `wp-json` pathOr you just install the [`Basic Auth Plugin`](https://github.com/WP-API/Basic-Auth) on your own Wordpress blog.