We’re moving a website to WordPress, and I need to modify our iPhone app to get data from the new site.
Currently it gets neatly structured data out of our database, but now all data will be stored in the text of WordPress posts and formatted by WP plugins.
Any suggestions for a good way to get that data to the app? I know very little about WordPress- is there an easy way to get the raw text of a post? I thought there would be a plugin for that but I haven’t been able to turn anything up. And I’d like to avoid just parsing the page HTML for obvious reasons.
You still have direct access to WordPress’s database. The posts are in the wp_posts table.
If you want the post text after it’s transformed by any plugins you’re using, then use the RSS feed. WordPress puts it at /feed by default.
You could also create your own custom XML interface by simply creating a WordPress theme. There’s no reason your theme needs to have HTML inside of it, it can produce XML, JSON or whatever you want.
Best I can think of is get an RSS plugin and read the post data using the feed that it generates? The feed I have has both formatted and unformatted text so should be easy to read in the unformatted version for use in the app.