0

I want to make an android app for my university which shows notices, schedules etc. posted on its website.

However there is no xml/json api for the site. So I need to parse the web pages (especially the homepage) to extract text & show it in my app.

Earlier I thought of using jSoup in my app but now I want to do this in a php-based server which pushes the data to my app.

What are my options ? Will phpQuery or SimpleHTMLDOM do the job ??

JJJ
  • 32,902
  • 20
  • 89
  • 102
Shantanu Paul
  • 706
  • 10
  • 26
  • Yes, they'll do the job fine. Just note that if the page changes layout (which *does* happen from time to time) your crawler will most likely stop working (unless they keep the same structure which is rare). – h2ooooooo May 22 '14 at 07:02
  • 1
    Also make sure you're allowed to do that. No one likes seeing their content at some other place – asprin May 22 '14 at 07:03
  • 1
    I'd go for a combo of `curl` and `SimpleXML`. – Klemen Tusar May 22 '14 at 07:05
  • @techouse Agreed though DOM handles HTML better than SimpleXML. Also, you only need cURL if the HTTP fopen wrappers aren't enabled – Phil May 22 '14 at 07:06
  • Hah, totaly forgot about `DOMDocument`. Yea that would be better. – Klemen Tusar May 22 '14 at 07:09
  • Nah! The page never changes layout. And can someone explain what is the use of curl ?? About the contents, nobody cares. – Shantanu Paul May 22 '14 at 07:51
  • @ShantanuPaul [cURL](http://www.php.net/curl) just fetches the data. See it as a simple browser that just receives and sends text, and it's your job to convert that text to an image/json/whatever. – h2ooooooo May 22 '14 at 08:05

0 Answers0