Save a remote WordPress post into your local MongoDB. Works in WordPress (4.7 or above) or any WordPress installation which have WP-REST-API enabled.
git clone https://github.com/joelgarciajr84/wp-to-mongo
cd wp-to-mongo
npm install
nodejs server.js
Will be running at your browser at port 8484
- First one is 'siteurl' (http://mybeautifulwebsite.com/wp-json/wp/v2/posts)
- Second is 'postid' which is the post id you want to retrieve and save at your local MongoDB
- Full sample: http://localhost:8484/?siteurl=http://mybeautifulwebsite.com/wp-json/wp/v2/posts&postid=5068
- If everything works fine you should see this message:
{
"POST": "5068",
"STATUS": "Saved successfully"
}
- Remote Data Retriever or a detached Database to other uses
- Remote Backup
- Data Mining - BigData etc.
- There is no delay in the requests, so you can write an application that sends the ids in a loop to be checked and saved in the database.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D