WordPress frontend app questions

Hi,

Someone has asked me to do a app for them and part of the App is they want me to read in their WordPress blog.

I have installed a JSON plugin into WP and am reading in values using that. Everything seems fairly fine in a live internet connected sort of way but my question is more how to deal with the app when no internet connection is available.

I know the obvious answer is store the data locally but my questions are -

What format should I store (mySQL, JSON) ?

How much data do I store (this is a massive WP site) ?

Has anyone done a pull to refresh on a tableview ?

I was thinking of maybe pulling down 10 posts from each category initially and then adding to that with anything new from then on.

Also am thinking long term, should I have a tidy button that deletes old posts or maybe do that as part of the update from the WP site, say delete anything that is 30 days old or something.

Dave [import]uid: 117617 topic_id: 26908 reply_id: 326908[/import]

Maybe you should use SQLite.
I have an app that sync from mySQL to SQLite with JSON in between, it works.
The most difficult part is to make the sync process good.

I have a global timestamp on the mobile that I update AFTER sync. If the timestamp of the app is older than the timestamp of the server, I update.

How do you manage images in the post ?

I do not use wordpress now, I use HTML file : I download them, then I parse them to find images references, then I download images.

If anyone have a good way to make sync, I would be happy to compare and upgrade mine, which is quite a raw update process. [import]uid: 5578 topic_id: 26908 reply_id: 109183[/import]

SQLite is what I meant not mySQL, I thought it was called something different but couldn’t think what it was.

At the moment am ignoring images, but that is something I also need to think about.

Wouldn’t it be great if everyone was just connected to the internet all all times :wink:

EDIT: Am using ui code from a sample, didn’t realise there is now a widget library instead. Looks like it has a lot more functionality like swipe left/right etc…

Dave [import]uid: 117617 topic_id: 26908 reply_id: 109191[/import]

I attacked this using the RSS feed’s for the site. I store the feed in the system.CachesDirectory and use that if I don’t have network access.

[import]uid: 19626 topic_id: 26908 reply_id: 109220[/import]

I downloaded your RSS Reader app robmiracle and was going to go with the RSS option but JSON looked so much easier to work with than RSS.

Dave [import]uid: 117617 topic_id: 26908 reply_id: 109231[/import]

There is a json export api : http://wordpress.org/extend/plugins/json-api/other_notes/

which seems great for what we are trying to do :slight_smile:

[import]uid: 5578 topic_id: 26908 reply_id: 110696[/import]

fpierron that is the plugin I currently use.

Seems pretty good but for some reason when I pull the categories, the post count in each category has one more post than it should.

If I use URL/get_category_index/ and get the post_count is might say 6 in a category but then if I pull the posts for that category using URL/get_category_posts/?id=CAT_ID it returns 5 posts.

Can’t work out why.

EDIT: Forgot to mention, this site is great for viewing your returned JSON http://jsonlint.com/

Dave [import]uid: 117617 topic_id: 26908 reply_id: 110737[/import]

Not sure.
Maybe you count 5 from 1 to 5= 5 and 0 to 5 = 6 in another way ?

Or maybe you have a “dead” category, excluded in your count (like uncategorized).

Frederic [import]uid: 5578 topic_id: 26908 reply_id: 110744[/import]

No am not counting, the JSON returned already has the count included for each category.

For now am just showing the count minus 1 and that seems to work.

Dave [import]uid: 117617 topic_id: 26908 reply_id: 110854[/import]