I have user generated content that is created in a mobile app that is written to a SQL Database.
I’d like to create a new site that allows this content to be viewed on a per user basis. So if I go to
It’ll show all the content I’ve created in the mobile app. i want to use wordpress to eliminate the need to recreated my own content publishing engine and get the benefits of all of the wordpress ecosystem with plugins, templates, etc. Even basic things like “search” are free vs. needing to build it myself if I roll my own content publishing system.
To accomplish this, I think I need to:
-
Be able to programmatically create wordpress posts. I want code running on another server (e.g. Google App engine) to call onto my server hosting wordpress (e.g. regular shared hosting) and create a blog post for each time a user saves new content in my mobile app. In order to do this there needs to be an web service to do this or I write directly to the DB?
-
Be able to programmatically edit the blog post once it’s saved, if the user edits the content in my mobile app. Same need for a web serices
-
Need to be able to have unique URLs for each user of my mobile app and show only their blog posts, but it’s still all part of the same instance of wordpress. So http://foo.com/users/UserA vs. http://foo.com/users/UserB. Both on same blog, each URL will show a filtered view of posts only done by that user.
-
I need to create real or fake user accounts. Since the content is really in my mobile app, my users have accounts with me and stored in SQL. So when I push the content to WordPress to create the content, it’s not really the user that is doing it. So if I wanted to push content for userA and userB, how would the user accounts get created? Or should I overload the use of tags and say set a tag as
user=UserA
then when I need to accomplish what I describe in #3 above, I just use/tags/user=UserA
? (I’m clearly open to suggestions)
Is what I need even remotely possible or am I on drugs?
It’s certainly possible. Just about everything WordPress does, including inserting users and posts, can be done programmatically using the WordPress API. As far as doing it remotely is concerned though, you may need to roll some of your own code to expose it to an external app. Also have a look at the XML-RPC interface, which can be used to create posts remotely.
It sounds possible to me. I know plugins like Twitter Tools can handle the first 2 points – pull in tweets and create new editable posts for each one – which is basically what you’re trying to do for your own app? Maybe you could look at it and see how it handles the transition. It seems like assigning these posts to specific users would be possible as well. Best of luck to you!
XML-RPC
XML-RPC
WP already has this. They’re called author archives:
/author/userA
.Using tags could work and as long as you don’t use them for anything else, you can change the tag base from the admin to be ‘users’, for example.