-2

I am trying to fetch and store the real-time data displayed on a PHP-based webpage. Being a complete newbie in webpage, I need some pointers, with which I can start learning and exploring myself.

The webpage that I wish to extract data from is http://www.ee.iitb.ac.in/~anil/

I am only wishing for some pointers. Thanks!

Sibbs Gambling
  • 19,274
  • 42
  • 103
  • 174
  • 1
    Are you trying to fetch data from that image? That will be very difficult, because it is an actual image being generated by PHP. – Alex W Feb 11 '14 at 16:11
  • @AlexW Not necessarily from that image. I hope to get the data that generates that image. – Sibbs Gambling Feb 11 '14 at 20:39
  • More than likely, you can't. The data resides on their server, and is being used to generate an actual image file which is sent to your browser via PHP's HTTP `content-type` header. – Alex W Feb 11 '14 at 20:41

2 Answers2

4

xkcd
> xkcd

And now for seriousness...

"real-time" is not something you should aim for. Because as soon as you get a handful of users online, unless you have a really powerful server or better still a cluster, then your site will die a horrible, fiery death.

Instead, you should figure out what is "real-time enough". Typically I have things update every five seconds or so, sometimes even 15 seconds is okay. If you're extracting data from another website, it may help to know how often that website updates and set your update speed to match (for instance, I once used to extract currency exchange rates from a site that updated once every 24 hours, so I updated once every 24 hours)

Depending on how frequent this is, it may be as simple as

setTimeout(function() {location.reload();},5000); // reload after 5 seconds

Alternatively, look into some AJAX solutions, polling the server at set intervals.

Community
  • 1
  • 1
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
0

I don't think it's possible. It uses iframe for loading that graph.So it can be loaded only via web browser.If you try to fetch the contents via php script / curl you will only get an error Your browser does not support iframes.

Harikrishnan
  • 9,688
  • 11
  • 84
  • 127