Wordpress博客iPhone App Reader

Wordpress博客iPhone App Reader

问题描述:

我有一个wordpress博客,它引用了当天的交易类型,我希望制作一个简单的iPhone应用程序,自动下载博客内容(想想RSS类)。我希望我的读者能够保存他们最喜欢的帖子,我需要能够显示所有档案的访问权限(迄今为止约有440个帖子)。我还需要它在检测到新帖子时发送推送通知。无论如何,我一直在看RSS源,但看起来我只能显示最后十个。

I have a wordpress blog that's sort of a quote of the day type of a deal and I am looking to make a simple iPhone app that automatically downloads the blog content (think RSS—kind of). I want my readers to be able to save their favorite posts and I need to be able to show access to all archives (about 440 posts to date). I also need it to send a push notification when a new post is detected. Anyway, I have been looking at RSS feeds, but it looks like I can only show the last ten.

就iPhone编程经验而言,我绝不是一个noobie。但是,我主要从事游戏项目,而且我对编程(下载,解析等)的互联网方面没有太多经验。

As far as iPhone programming experience, I'm by no means a noobie. However, I have mostly worked on game projects and I don't have very much experience with the internet side of programming (downloading, parsing, etc.).

任何想法都将不胜感激。我只需要指向正确的方向。

Any ideas would be appreciated. I just need to be pointed in the right direction.

这就是我要做的事,虽然我确信有很多解决方案:

Here's what I would do, though I'm sure there are many solutions:


  • 以JSON代替RSS(XML)访问WP博客。一般来说,我发现JSON库比iOS中的XML库更容易使用。这是我遇到的第一个插件,它看起来像是一个API,而不仅仅是Feed的转换。希望这将为您提供更多支持,以查询档案或特定帖子或日期范围等内容: http:// wordpress .org / extend / plugins / json-api /

决定是否要从每个wp帖子加载所有内容,或只加载标题。这有点取决于每个帖子的大小,你如何显示它们等等。只需获取+解析所有帖子标题然后对所选帖子的内容进行后续查询可能会更快。

Decide if you want to load ALL content from each wp post, or just the titles. This kinda depends on how big each post is, how you're displaying them, etc. It might be quicker to just fetch + parse all the Post Titles and then make a subsequent query for a selected post's content.

使用 NSMutableURLRequest NSURLConnection 等加载数据。使用json-framework解析这些数据,一旦你进入你的应用程序(我通过斯坦福iOS开发讲座找到它)。很容易将json字符串转换为NSDictionary: https://github.com/stig/json-framework/

Load the data with NSMutableURLRequest and NSURLConnection, etc. Use the json-framework to parse this data, once you get it into your app (I found it through the Stanford iOS dev lectures). Quite easily converts a json string into a NSDictionary: https://github.com/stig/json-framework/

至于加载所有档案,理想情况下,您可以使用wp json插件不断查询旧帖子,并可能将加载的帖子的时间戳存储在设备上,以便您不需要多次获取数据。

As for loading all archives, ideally you can continually query for older posts with your wp json plugin, and maybe store the loaded post's timestamps on the device so that you don't need to fetch data more than once.

至于保存所有这些(包括收藏夹),我会考虑使用CoreData。 http://developer.apple.com/library/ios/#文档/ DataManagement / Conceptual / iPhoneCoreData01 / Introduction / Introduction.html

As for saving all this (including favorites), I'd look into using CoreData. http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html

推送通知完全是另一个野兽!我想最好的方法是在服务器的某个地方存储所有订阅者的推送令牌,然后编写某种PHP脚本,在一段时间内触发您的APNS服务,检查新帖子,并相应地发送通知。 / p>

Push notifications are another beast entirely! I suppose the best approach would be to store push tokens of all your 'subscribers' somewhere on your server, then write some kind of php script that triggered your APNS service on an interval, checked for new posts, and sent out notifications accordingly.

祝你好运!