0

I'm trying to make a view with Swift on Xcode that shows the schedule of an event day.

The problem is that, while I'm trying to make the schedule dynamic, so that it changes depending on the data from a website, the way to do so is elusive.

For example, if there already is a schedule posted on website, what could I do so that the schedule showed on the app changes depending on the schedule on the website?

Or, as an alternative, could I maybe bring data from a google doc that lists a schedule to be shown on the schedule view of my app?

Merely using a webview and linking the website page isn't good enough, as it would be no better than posting a link on the app.

I know these are very broad questions, but I was wondering if the community has better ideas to offer, or some efficient ways to carry out those two aforementioned procedures.

Daniel
  • 55
  • 8

1 Answers1

1

Yes. Using WebView is a lazy method and is not efficient.

The best solution to do this is by scrapping the data from that website. There are lots of scrapping libraries available for many languages. Usually called HTML DOM parsers. I prefer this one: http://simplehtmldom.sourceforge.net/ It's built on PHP. Though its name says "simple", it's very powerful. Read their docs. These scrappers read data from HTML code and parse based on certain rules like id, class etc. You can then convert this data to JSON/XML and then use it in your app

Before doing this, check whether that website has any sort of API

Gijo Varghese
  • 11,264
  • 22
  • 73
  • 122
  • I have also zero knowledge of web programming (I only learned the syntax of html before), so I'm a bit confused as to how to use this library. Does this mean that I study simplehtmldon, use it as PHP language to read data from html code, then convert it to JSON? – Daniel Oct 04 '16 at 13:54
  • Yes. You have to learn any sort of server side language like PHP. HTML knowledge is not needed for generating JSON. – Gijo Varghese Oct 10 '16 at 04:40