From: Rick S. <Mis...@co...> - 2004-11-11 04:21:07
|
I wondered about that, but it didn't fix it. I'm using the same code from internet_top10, which does work. the frustrating this is that if I include the whole URL it works, if I make the URL a variable it doesn't. It's in double-quotes, the whole thing should be interpreted, right? Works: $p_USGS_list = new Process_Item("get_url" . "http://waterdata.usgs.gov/nwis/current?multiple_site_noblahblahblah " . "$f_USGS_html"); Doesn't work: my $USGS_URL = "get_url $USGS_URL $f_USGS_html"; $p_USGS_list = new Process_Item("$USGS_URL"); Doesn't work: my $USGS_URL = "$USGS_URL"; $p_USGS_list = new Process_Item("get_url $USGS_URL $f_USGS_html"); So the problem is that I can't pass the actual URL as a variable. I have no idea WHY, but at least I can make it work now, by making all the string changed INSIDE of the Process_Item call. Whenever I start thinking I might actually not be clueless, Perl up and whacks me on the side of the head . . . rick At 05:57 PM 11/10/2004, you wrote: >Forget my previous suggestion; I was thinking Linux. Try defining the >filename with backslashes. > >David > >----- Original Message ----- From: "Rick Steeves" <mis...@co...> >To: <mis...@li...> >Sent: Tuesday, November 09, 2004 9:29 PM >Subject: Re: [misterhouse-users] get_url not returning data? cgi problem? > > >>The original example gives: >>Warning, could not open file_read file d:/misterhouse/data/web/USGS.html: >>No such file or directory. >> >>With the suggested change I get: >>Retrieving (with simple) http://'' into d:/misterhouse/data/web/USGS.html >>... ge >>t failed >>Warning, could not open file_read file d:/misterhouse/data/web/USGS.html: >>No such file or directory >> >>yet >>$p_USGS_list = new Process_Item("get_url >>http://waterdata.usgs.gov/nwis/current?multiple_site_no=02096960%0D%0A02085070%0D%0A02102500&search_site_no_match_type=exact&index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&index_pmcode_00065=3&sort_key=site_no&group_key=NONE&sitefile_output_format=html_table&column_name=site_no&column_name=station_nm&column_name=state_cd&column_name=county_cd&column_name=alt_va&column_name=huc_cd&sort_key_2=site_no&html_table_group_key=NONE&format=rdb&rdb_compression=value&list_of_search_criteria=multiple_site_no%2Crealtime_parameter_selection >>$f_USGS_html"); >> >>works. >> >>if (time_cron ('0-59 * * * *')) {print_log("$USGS_URL"); } >>prints out a URL that I can cut and paste and have work, so the URL and >>variable is correct. >> >>Sigh >> >> >> >>At 06:05 PM 11/9/2004, David Norwood wrote: >>>Try >>> >>>$p_USGS_list = new Process_Item("get_url '$USGS_URL' $f_USGS_html"); >>> >>> >>> >>>----- Original Message ----- From: "Rick Steeves" <mis...@co...> >>>To: <mis...@li...> >>>Sent: Sunday, November 07, 2004 8:10 PM >>>Subject: [misterhouse-users] get_url not returning data? cgi problem? >>> >>> >>>>I'm trying to get >>>>http://waterdata.usgs.gov/nwis/current?multiple_site_no=02096960%0D%0A02085070%0D%0A02102500&search_site_no_match_type=exact&index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&index_pmcode_00065=3&sort_key=site_no&group_key=NONE&sitefile_output_format=html_table&column_name=site_no&column_name=station_nm&column_name=state_cd&column_name=county_cd&column_name=alt_va&column_name=huc_cd&sort_key_2=site_no&html_table_group_key=NONE&format=rdb&rdb_compression=value&list_of_search_criteria=multiple_site_no%2Crealtime_parameter_selection >>>> >>>>back using get_url, but nothing comes back. >>>> >>>>$USGS_URL = >>>>"http://waterdata.usgs.gov/nwis/current?multiple_site_no=02096960%0D%0A02085070%0D%0A02102500&search_site_no_match_type=exact&index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&index_pmcode_00065=3&sort_key=site_no&group_key=NONE&sitefile_output_format=html_table&column_name=site_no&column_name=station_nm&column_name=state_cd&column_name=county_cd&column_name=alt_va&column_name=huc_cd&sort_key_2=site_no&html_table_group_key=NONE&format=rdb&rdb_compression=value&list_of_search_criteria=multiple_site_no%2Crealtime_parameter_selection"; >>>> >>>>my $f_USGS_html = "$config_parms{data_dir}/web/USGS.html"; >>>>$p_USGS_list = new Process_Item("get_url $USGS_URL $f_USGS_html"); >>>> >>>>doesn't create a html file. Any ideas? My suspicion is that either >>>>it's because it's not a flat HTML page, but a cgi-query, or because the >>>>page that comes back isn't HTML, it's a flat text file. >>>> >>>>Rick >>>> >>>> >>>> >>>>Rick Steeves >>>>ri...@si... http://www.sinister.net >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.Net email is sponsored by: >>>>Sybase ASE Linux Express Edition - download now for FREE >>>>LinuxWorld Reader's Choice Award Winner for best database on Linux. >>>>http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >>>>________________________________________________________ >>>>To unsubscribe from this list, go to: >>>>http://sourceforge.net/mail/?group_id=1365 >>> >>> >>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by: >>>Sybase ASE Linux Express Edition - download now for FREE >>>LinuxWorld Reader's Choice Award Winner for best database on Linux. >>>http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >>>________________________________________________________ >>>To unsubscribe from this list, go to: >>>http://sourceforge.net/mail/?group_id=1365 >> >> >>Rick Steeves >>ri...@si... http://www.sinister.net >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: >>Sybase ASE Linux Express Edition - download now for FREE >>LinuxWorld Reader's Choice Award Winner for best database on Linux. >>http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >>________________________________________________________ >>To unsubscribe from this list, go to: >>http://sourceforge.net/mail/?group_id=1365 > > > >------------------------------------------------------- >This SF.Net email is sponsored by: >Sybase ASE Linux Express Edition - download now for FREE >LinuxWorld Reader's Choice Award Winner for best database on Linux. >http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >________________________________________________________ >To unsubscribe from this list, go to: >http://sourceforge.net/mail/?group_id=1365 Rick Steeves ri...@si... http://www.sinister.net |