[localhost:~]$ cat * > /dev/ragfield

Wednesday, May 26, 2010

Power Smart Pricing

Ameren Illinois Utilities Power Smart Pricing data is available in tabular form on the web. This function will scrape that data and return the rate in US dollars for a given date/time. My friend John wanted to use this data for something I didn't quite understand...

Date[]
{2010, 5, 26, 16, 3, 34.163065`8.286131807151374}
PowerSmartPrice[{y_, m_, d_, h_, mm_, s_}]:=Module[
    {url, data},
    url = StringJoin["http://www.powersmartpricing.org/chart/?display=table&price_dt=", ToString[m], "/", ToString[d], "/", ToString[y]];
    data = Import[url, "Data"][[2;;]];
    ToExpression[StringDrop[data[[Floor[h] + 1, 2]], - 1]] / 100.
];
PowerSmartPrice[Date[]]
0.065`
PowerSmartPrice[{2010, 5, 25, 16, 0, 0}]
0.066`

2 comments:

Cara said...

Let me know if you ever understand my husband

daisiefabbri said...

Casinos Near Philadelphia - MapYRO
Search for 경주 출장마사지 Casinos Near Philadelphia in 춘천 출장마사지 MapYRO, IL and track traffic updates 1. Hollywood Casino 창원 출장안마 at Charles Town 안동 출장안마 Races. 2. Harrah's Chester Casino 대구광역 출장안마 & Racetrack