@@ -10,6 +10,7 @@ import feshiedb
10
10
# Only need one station at the moment so can b e hardcoded - done is such a way
11
11
# as to make conversion if needed easier
12
12
URL = "http://apps.sepa.org.uk/waterlevels/default.aspx?sd=t&lc=234217"
13
+ CSV_URL = "http://apps.sepa.org.uk/database/riverlevels/234217-SG.csv"
13
14
LOCATION_ID = "Feshie Bridge"
14
15
15
16
DEFAULT_LOG_LEVEL = logging .ERROR
@@ -26,10 +27,7 @@ class sepa_riverdepth_fetcher(object):
26
27
self .logger .critical ("No database connection" )
27
28
exit (1 )
28
29
29
- def fetch_river_depth (self , url ):
30
- self .logger .debug ("Getting data from %s" , url )
31
- page = self .get_page (url )
32
- csv_link = self .get_csv_link (page )
30
+ def fetch_river_depth (self , csv_link ):
33
31
if csv_link is not None :
34
32
self .logger .debug ("Downloading CSV from %s" , csv_link )
35
33
csv = self .get_page (csv_link )
@@ -95,4 +93,4 @@ if __name__ == "__main__":
95
93
else :
96
94
CONFIG = OPTIONS .config_file
97
95
SEPA = sepa_riverdepth_fetcher (CONFIG , LOG_LEVEL )
98
- SEPA .fetch_river_depth (URL )
96
+ SEPA .fetch_river_depth (CSV_URL )
0 commit comments