Sabi ni Obet noong Fri, Apr 3, 2015 at 9:45 AM:
> The output of the url below is a .CSV file (hourly-updated electricity
> demand for Luzon).
>
> http://wesm.ph/chart/export/luzon_dmd_csv_export.php?date=20150403&hour=10
<http://wesm.ph/chart/export/luzon_dmd_csv_export.php?date=20150403&hour=10>
>
> This url is triggered when I click on a button online.
>
> What I want to do is to download the resulting .csv file using wget.
>
> But I keep getting an empty .csv file when using wget (I've tried
> several suggestion I got on the Web). I know a .csv file is generated
> somewhere because I get it when I click the CSV button online.
>
> Any suggestions?

Worked on my FreeBSD partition. Also worked on my GNU/Linux partition,
just tested it so's I don't have to convince you to install FreeBSD :)

Note that the URL contains *two* characters that the shell treats
differently. You'll have to either escape them or enclose the URL in
quotation marks, i.e:

wget "
http://wesm.ph/chart/export/luzon_dmd_csv_export.php?date=20150403&hour=10";

Here's the result I got:

cat "luzon_dmd_csv_export.php?date=20150403&hour=10"
HOUR,LUZDEM_DAPEL,LUZDEM_RTDEL,LUZDEM_RTXEL,LUZLWAP_DAPEL,LUZLWAP_RTDEL,LUZLWAP_RTXEL

1,4770.1,4784.2,4775.3,1342.27,1409.69,1410.26
2,4411.5,4656.9,4624.7,44694.41,1632.39,1631.04
3,4248.6,4468.1,4474.6,46206.81,1625.77,1626.42
4,4150.9,4377.8,4300.2,47164.91,1449.69,1337.38
5,4277.8,4258.8,4188.5,1174.85,1174.34,1173.2
6,3864.1,4005.2,3981.3,49548.6,382.99,249.36
7,3704.3,3860.9,3897.2,51694.22,0,204.11
8,3825.3,4024.3,3982.9,58371.16,206.72,204.79
9,4158.1,4176.1,4169.1,516.84,518.46,508.79
10,4130.6,4343.2,,55169.33,810.06,
11,4265.5,,,53617.68,,
12,4259.4,,,53636.83,,
13,4410.7,,,52419.85,,
14,4481.8,,,51478.37,,
15,4448.4,,,51734.69,,
16,4339.4,,,51543.17,,
17,4226.3,,,52604.57,,
18,4361.7,,,51920.13,,
19,5050.8,,,56180.15,,
20,5148,,,55239.16,,
21,5234.5,,,54377.99,,
22,5352.8,,,53303.8,,
23,5186.6,,,55145.97,,
24,4915.6,,,49970.37,,

One other thing: I was too lazy to set an output file with -O
 *output-file*.


Sometimes you don't need a script :)

   *Daniel Escasa*
Technologist. Writer and Editor. Shakespearean actor
  <http://google.com/+DanielEscasa>
<http://ph.linkedin.com/in/danielescasa>
<http://www.twitter.com/silverlokk>  <http://facebook.com/silverlokk>
   "Why can we remember the tiniest detail that has happened to us, and not
remember how many times we have told it to the same person." - François de
la...
<https://www.quotesdaddy.com/quote/463816/franois-de-la-rochefoucauld/why-can-we-remember-the-tiniest-detail-that-has-happened>
In necessariis unitas, in dubiis libertas, in omnibus caritas.
If we choose being kind over being right, we will be right every time.
 Get a signature like this:
<http://ws-stats.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcGFpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>
Click
here!
<http://ws-stats.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcGFpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to