House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search cf-talk

August 28, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Reading data from a website

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob Parkhill
04/21/2008 04:57 PM

Good day, I have been tasked to get temperature data on a daily basis from a website.  I thought that I had seen something about this from somewhere, but can't seem to put my finger on it, so, Is there a way that I can automatically get data from another website that is stored in a table, by calling a function...?  I want to get two values from specific days. I would like to be able to take all the data that is stored in a table and put it into a structure then I can parse out what I need.   so A) Is this possible?    B) a Few pointers if you don't mind? Thanks, Rob

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
04/21/2008 05:04 PM

> I have been tasked to get temperature data on a daily basis from a website Good evening, This very much depends on a couple of factors: * If you own the application that is publishing the temperatures -  You could create a webservice that other applications can access, -  You could publish rss feeds that other applications can access * If you do not own the application that is publishing the temperatures: - If by table you mean HTML table, then it *should* be possible to parse the html and extract the data you need though this depends on the html source. Post a link and I'll let you know ;) - If by table you mean database table, then unless the application formally publishes the data through a feed or webservice then you won't be able to access it. HTH Dominic -- Blog it up: http://fusion.dominicwatson.co.uk

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob Parkhill
04/21/2008 09:16 PM

Good evening to you Dominic, below is the link to the website that contains the data I require. It is in an HTML table, so I guess that I am screen scraping? http://www.climate.weatheroffice.ec.gc.ca/climateData/dailydata_e.html?timeframe=2&Prov=CA&StationID=43763&Year=2008&Month=4&Day=17 I have the same page for 5 other locations. There are problems with using a webservice etc, as this is for an agricultural business and the locations that I require information for smaller locations.  I did not find a webservice that even carried Canadian data :). TIA, Rob ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
04/21/2008 09:45 PM

Right, parsing that page, as Dave said, will suck. It's not xml so xml parsing is out (that would then be reasonably easy). So you'd need a load of regex and parsing wizardry. It IS possible though. Again, as Dave pointed out, when their code changes, your app breaks. However, if you look at the navigation options in the bottom right hand corner you will see a Bulk data link with a link to a page that generates Xml of the data :) Have a look at some of that xml and you will find all the data ready for simple xml parsing; it looks like you can get data for months, whole years, etc - as it is built dynamically from a URL query string. Have fun with that! Dominic -- Blog it up: http://fusion.dominicwatson.co.uk

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Claude Schneegans
04/22/2008 09:42 AM

>>below is the link to the website that contains the data I require. Ok, you definitely need CF_REextract: http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm You can even test it on your page here: http://www.contentbox.com/claude/customtags/REextract/testingREextract.cfm 1. Select http for inputmode 2. Enter dataTableRowData"> in RE1 3. enter </td> in RE2 4. enter the address of your page in the URL field, 5. click Test, and voilààààà... For your final solution, you will use a just little more sophisticated loop to extract exactly what you need. See also this page which uses the same tag to extract weather forecast from environment Canada: http://www.fafo.on.ca/ -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon@internetique.com) Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
04/22/2008 10:10 AM

Once again, you "definitely" DON'T need it. Paul has already offered two MUCH more effiecient FREE solutions. .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com >>below is the link to the website that contains the data I require. Ok, you definitely need CF_REextract: http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm You can even test it on your page here: http://www.contentbox.com/claude/customtags/REextract/testingREextract.cfm 1. Select http for inputmode 2. Enter dataTableRowData"> in RE1 3. enter </td> in RE2 4. enter the address of your page in the URL field, 5. click Test, and voil?????... For your final solution, you will use a just little more sophisticated loop to extract exactly what you need. See also this page which uses the same tag to extract weather forecast from environment Canada: http://www.fafo.on.ca/ -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon@internetique.com) Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
James Smith
04/22/2008 10:31 AM

>  >>below is the link to the website that contains the data I require. > >  Ok, you definitely need CF_REextract: >  http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm No, you don't. I have NEVER come across a situation where I needed a commercial solution to regex in CF, and I use regex a lot and have done screen scraping with it too. -- Jay

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
04/22/2008 03:09 PM

On Tue, Apr 22, 2008 at 7:31 AM, James Smith <james@music-express.co.uk> wrote: ----- Excess quoted text cut - see Original Post for more ----- http://tinyurl.com/5holdg -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. "Arf," she said.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
04/22/2008 03:34 PM

I'll take one! :-) .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com http://tinyurl.com/5holdg

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
04/21/2008 05:05 PM

On Mon, Apr 21, 2008 at 1:57 PM, Rob Parkhill <robert.parkhill@gmail.com> wrote: > Good day, > >  I have been tasked to get temperature data on a daily basis from a website. I thought that I had seen something about this from somewhere, but can't seem to put my finger on it, so, Is there a way that I can automatically get data from another website that is stored in a table, by calling a function...?  I want to get two values from specific days. > >  I would like to be able to take all the data that is stored in a table and put it into a structure then I can parse out what I need. http://www.google.com/search?q=weather+webservice that'd be a place to start.  find the web service that suits your needs.  depending on which one you choose, there may even be docs available that show how to integrate it into your site. -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. "Arf," she said.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
04/21/2008 05:06 PM

----- Excess quoted text cut - see Original Post for more ----- If the web site has a web service - a program you can call directly via a HTTP URL - then, yes, you can easily get whatever data that web service publishes. Web services typically publish data using XML, which is easily parsed. Otherwise, you will have to use CFHTTP to fetch the web page in question, and you will have to use string functions to parse out the bits you need, and the process of building and maintaining this functionality will suck, to put it bluntly. If the formatting of the web page changes later, you'll probably have to edit your code accordingly. This process is generally referred to as "screen scraping". I would go for the web service approach. There are probably plenty of web sites that offer a daily temperature web service, although they might want you to pay for it. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group

<< Previous Thread Today's Threads Next Thread >>

Mailing Lists