项目作者: natinho68

项目描述 :
Generate automatically Wordpress posts from a JSON feed
高级语言: PHP
项目地址: git://github.com/natinho68/wp-FeedToPosts.git
创建时间: 2018-07-13T16:16:40Z
项目社区:https://github.com/natinho68/wp-FeedToPosts

开源协议:

下载


JSON Feed wp-posts importer

A posts importer based on a JSON stream.

Posts generation by form and handle an automation system.


Thanks to this tutorial Creating Custom WordPress Administration Pages and to Easy WordPress Admin Notifications, which helped me a lot for the creation of this plugin

Getting Started

  • Local server environment or live server

Prerequisites

  • Tested on WP 4.9.7

  • Your Feed must be a JSON, and formatted like this below

    1. {
    2. "items": [
    3. {
    4. "pubdate": "Thu, 21 Dec 2000 16:01:07 +0000",
    5. "description": "Your content (html is ok)1",
    6. "title": "Title1"
    7. },
    8. {
    9. "pubdate": "Thu, 21 Dec 2000 16:01:07 +0000",
    10. "description": "Your content (html is ok)2",
    11. "title": "Title2"
    12. }
    13. ]
    14. }

I do not know if it will work on previous or higher versions

Installing

  • Clone or download the repository, and put files into /wp-content/plugins/
  1. https://github.com/natinho68/wp-FeedToPosts.git
  • Activate the plugin
  • Go to the Feed to posts page in the admin menu
  • Put a feed and click on “Generate Posts”
  • Your posts have been imported

Automation

Please note that for automation, you must first inject posts via the form in the settings of the plugin. Once done, you are free to do automation as explained below.

If you want to check that new posts are available in your feed, add a cron job like this (here every 5 minutes) :

  1. */5 * * * * wget http://YOURDOMAIN.DOMAIN/?rest_route=/FeedToPosts/v1/feedtoposts

If you want simple authentication, add a .htaccess require_auth and .htpasswd pair, for this url. Just add --user user --password pass to your cron job.

Author

Nathan MEYER