NewInProgramming
NewInProgramming

Reputation: 13

jQuery Mobile data retrieval

What is the best way to retrieve data from multiple websites/pages and put them on 1 single application that gets auto-updated? say ,I want to take an article from yahoo, and another one from bbc and another one from the times then put them on a sort of listview, that gets autoUpdated, how would I go for that? I heard about JSON, but Since I'm new in jQuery Mobile programming, I'm not sure how this will work. Do I have to first, implement JSON on the websites I wanna take the article from, then use a JSON call from my App?or is there another way of doing this? Thanks for your advice in advance.

Regards, Ben

Upvotes: 1

Views: 367

Answers (1)

Gajotres
Gajotres

Reputation: 57309

It is not that hard.

There's no point in doing anything by yourself. Every major news site has a RSS feed. All you need is a jQuery RSS reader that can be used for article pulling. They can be than appended to the jQuery Mobile listview.

Here's one great jQuery RSS plugin: https://github.com/sdepold/jquery-rss

What to do:

  1. Create skeleton jQuery Mobile page
  2. Use RSS plugin to retrieve at least 10-30 articles
  3. Store articles in localStorage
  4. Display them in a listview
  5. Create another page
  6. When user clicks on a listview element pass a article parameter to the second page. Read my other article to find out how you can pass parameters from page to page: https://stackoverflow.com/a/14469041/1848600
  7. Before second page is loaded read rest of article data (from localStorage) and dynamically build page content. Read my other article how you can enhance markup of a dynamically created jQuery Mobile page: jQuery Mobile: Markup Enhancement of dynamically added content

Upvotes: 2

Related Questions