I have an iOS app that downloads HTML from web (that is not mine) and parses it to obtain the data I need. The problem is that when they change the HTML of the web the mobile app crashed, and I’ve to change the code, and Apple stay more than one week to accept the update.
The idea is to to all the operations that now I do in the mobile app in a server or web, like have to act like a bridge, i.e., this server/web would download the HTML web, parse it and send the results to the mobile app. In this form I can do any change instantaneously.
My question is if I can do this without doing an application that needs servlets and a Tomcat server. Can I do it with a php file or something like that? I don’t need need to save any data, only parse a HTML and return to the mobile a response with a specified format.
Thanks for all.
PD: Sorry for my english, but it’s not my native language.
Yes, you can do that with PHP. BUT only when your web space is configured correct, very cheap and free providers often disable outgoing connections from your server.
In PHP you can make a HTTP GET request with just a single line:
If you need ability to get more information about the result of your HTTP GET request (like headers) you can still do this very easily by using
http_get():For more advanced GET/POST requests, you can install the CURL library: