1 Replies - 742 Views - Last Post: 26 May 2010 - 07:08 PM

#1 Guest_Garrett*


Reputation:

How do I take automatically updating data from a file and display it o

Posted 26 May 2010 - 02:54 PM

I want to make a website that displays USGS data about river flows. The USGS provides the following data that they update: http://waterdata.usg...roup_key=huc_cd and http://waterdata.usg..._retrieval_info

I know HTML, CSS, and some PHP but am not sure how to pull the data from the USGS site every few hours and display it on my own site. Can someone point me in the right direction please?

THANK!

Is This A Good Question/Topic? 0

Replies To: How do I take automatically updating data from a file and display it o

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5290
  • View blog
  • Posts: 14,121
  • Joined: 18-April 07

Re: How do I take automatically updating data from a file and display it o

Posted 26 May 2010 - 07:08 PM

This depends on many factors, but they do offer two methods of retrieving data. First if you are retrieving site data, then you can fetch that data through a URL in XML format. This is ONLY for site data. This URL can be supplied to functions like SimpleXML() if enabled and PHP5 or if you are still in PHP4 you can use Domxml_open_file().

If you are wanting the watar data for numerous sites, they offer this through a web service. You provide it a query (in the form of a call to a wsdl file) and can be done by enabling two extensions... extension=php_xmlrpc.dll and extension=php_soap.dll, then using the SoapClient class. This class takes the URL to the wsdl file that USGS provides at http://waterservices...WSService?wsdl. When you make a query, the web service will then return results to you in XML format and you can load it using the methods I have already described for loading XML.

Look on www.php.net for the SoapClient class for more information. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1