Jump to content

XML feed importer to map to new pages and fields


aaronjpitts
 Share

Recommended Posts

Hi Guys,

I have just started to experiment with Processwire and really like what I see so far. I am hoping to try my first production site on it soon. I have long been a wordpress user, but want something new and more efficient. I am wondering if there is a module/feature similar to this for wordpress: http://www.wpallimport.com/ it's a full XML importer where you can import to create new pages (posts on wordpress) and map parts of each entry to certain fields of each page. Is this possible for Processwire? I use this with the advacned custom field plugin on wordpress to great effect. Each time the plugin is run, it will update the posts if they have already been created, and add new ones for new entries in the XML feed.

I've seen this module, but does it work with the latest version, and could it work with what I need: http://modules.processwire.com/modules/process-data-import/

If anyone can point me in the right direction I would appreciate it.

Thanks,

Aaron

Link to comment
Share on other sites

Hi @aaronjpitts and welcome!

A few tools that might help you:

CSV importer: http://modules.processwire.com/modules/import-pages-csv/

Table CSV Import/Export http://modules.processwire.com/modules/table-csv-import-export/

Wordpress Migrator https://github.com/NicoKnoll/MigratorWordpress

Migrator (json export and import) https://github.com/adrianbj/ProcessMigrator

Please let us know if you have any specific questions about any of these.

  • Like 1
Link to comment
Share on other sites

Hi Adrian,

Thanks for your suggestions, but I don't think those modules could work to import data from an XML feed, right? This is the feed I need to import from: https://services.boatwizard.com/bridge/events/1f163739-f2a4-45fe-8274-0302f30a2f7d/boats?status=on

It would be to import boats, each boat having several fields such as price, length, location etc

Many thanks

Link to comment
Share on other sites

Yes, that's correct. Because the feed often updates with new entries (boats) being added, and old (sold) boats being removed.

Thanks

Good to know!

I think it might be worth you creating a converter that can be run via a cron job. 

Sorry I don't have time for a detailed example, so this might not be much use, but you can use one of the PHP xml to array (or maybe json) functions and then use the PW API to convert that into pages. It won't be terribly difficult, but not exactly trivial. There are several bits of code that might help you if you decide to tackle this - some from the Wordpress Migrator (xml to json) and Migrator (json to PW pages).

If you're willing to have a go, I am sure we can help you get through any roadblocks that come up.

  • Like 2
Link to comment
Share on other sites

Yipieh! Looks like a task for an importer script! :)

The XML has <DocumentID>123456</DocumentID> what seems to be the boat-article-ids. So, you can go with it manually via importer script, or first have a look for getting a PHP conversion lib that converts xml to csv and then maybe use the CSV module for importing.

But it is also very easy done manually with an importer script, (bootstrapping PW, running via cron or via PWs lazyCron). If you need any further explanation, please ask here.

EDIT: @Adrian beats me a few seconds :)

Edited by horst
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...