aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/home.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgi/home.cgi b/cgi/home.cgi
index fe567b2..603e7cf 100644
--- a/cgi/home.cgi
+++ b/cgi/home.cgi
@@ -3,7 +3,8 @@ require "net/http"
require "time"
def next_collection
- uri = URI("https://waste-api.york.gov.uk/api/Collections/GetBinCollectionDataForUprn/***REMOVED***")
+ uprn = File.read("../uprn").strip
+ uri = URI("https://waste-api.york.gov.uk/api/Collections/GetBinCollectionDataForUprn/#{uprn}")
resp = JSON.parse(Net::HTTP.get(uri))["services"].select { |c| Time.parse(c["nextCollection"]) > Time.now }.sort { |a, b| Time.parse(a["nextCollection"]) <=> Time.parse(b["nextCollection"]) }
out = ""