From 2d82c328537110228b74a366c5b2e95cd73fe847 Mon Sep 17 00:00:00 2001 From: Jared Chapiewsky Date: Sat, 4 Jan 2025 15:29:36 -0600 Subject: [PATCH 1/6] Add nearby tab to show locations within 5 miles add location logic for nearby tab --- importer/sites.json | 458 ++++++++++++++++++++++++++------------- site/index.html | 152 ++++++++++++- site/templates/index.eta | 59 ++++- 3 files changed, 499 insertions(+), 170 deletions(-) diff --git a/importer/sites.json b/importer/sites.json index 367854b..0122830 100644 --- a/importer/sites.json +++ b/importer/sites.json @@ -1,154 +1,304 @@ -{ - "sites" : [ - { - "name": "Oscar's", - "url" : "https://www.oscarscustard.com/index.php/flavors/", - "script": "./sites/oscars.ts", - "flavorOfTheDay": "" - }, - { - "name": "Kopp's", - "url" : "https://kopps.com/flavor-preview", - "script": "./sites/kopps.ts", - "flavorOfTheDay": "" - }, - { - "name": "LeDuc's", - "url" : "https://leducscustard.com/custard-calendar/", - "script": "./sites/leducs.ts", - "flavorOfTheDay": "" - }, - { - "name": "Bubba's", - "url" : "https://www.bubbasfrozencustard.com/events", - "script": "./sites/bubbas.ts", - "flavorOfTheDay": "" - }, - { - "name": "Murf's", - "url" : "http://www.murfsfrozencustard.com/", - "script": "./sites/murfs.ts", - "flavorOfTheDay": "" - }, - { - "name": "Gille's", - "url" : "https://gillesfrozencustard.com/flavor-of-the-day", - "script": "./sites/gilles.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Brookfield - W Capital Dr", - "url" : "https://www.culvers.com/restaurants/brookfield-capitol", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Robert's", - "url" : "https://robertsfrozencustard.com/", - "script": "./sites/roberts.ts", - "flavorOfTheDay": "" - }, - { - "name": "Kraverz's", - "url" : "https://www.kraverzcustard.com/FlavorSchedule", - "script": "./sites/kraverz.ts", - "flavorOfTheDay": "" - }, - { - "name": "Hefner's Frozen Custard", - "url" : "https://www.hefnerscustard.com/", - "script": "./sites/hefners.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Elm Grove - W Bluemound Rd", - "url" : "https://www.culvers.com/restaurants/elm-grove-wi", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Shorewood", - "url" : "https://www.culvers.com/restaurants/shorewood", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Mequon", - "url" : "https://www.culvers.com/restaurants/mequon", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Glendale - Bayside Dr", - "url" : "https://www.culvers.com/restaurants/glendale-wi-bayside-dr", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Milwaukee - W Layton Ave", - "url" : "https://www.culvers.com/restaurants/milwaukee-layton", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: West Milwaukee - Miller Pkwy", - "url" : "https://www.culvers.com/restaurants/west-milwaukee", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: West Allis - S 108th St", - "url" : "https://www.culvers.com/restaurants/west-milwaukee", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Pop's Custard", - "url" : "https://www.popscustard.com/", - "script": "./sites/pops.ts", - "flavorOfTheDay": "" - }, - { - "name": "Georgie Porgies", - "url" : "https://georgieporgies.com/georgies-flavor-forecast/", - "script": "./sites/georgie.ts", - "flavorOfTheDay": "" - }, - { - "name": "Golden Gyro", - "url" : "https://goldengyro.com/daily-flavors", - "script": "./sites/goldengyro.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Waukesha, WI - E Main St", - "url" : "https://culvers.com/restaurants/waukesha-hwy-164", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Waukesha, WI - Grandview", - "url" : "https://www.culvers.com/restaurants/waukesha-grandview", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Brookfield - 124th St", - "url" : "https://www.culvers.com/restaurants/brookfield-124th", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: New Berlin - W National Ave", - "url" : "https://www.culvers.com/restaurants/new-berlin", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - }, - { - "name": "Culver's: Milwaukee - Fond Du Lac Ave", - "url" : "https://www.culvers.com/restaurants/milwaukee-fond-du-lac", - "script": "./sites/culvers-brookfield.ts", - "flavorOfTheDay": "" - } - ] -} \ No newline at end of file +{ + "sites" : [ + { + "name": "Oscar's", + "url" : "https://www.oscarscustard.com/index.php/flavors/", + "script": "./sites/oscars.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Kopp's", + "url" : "https://kopps.com/flavor-preview", + "script": "./sites/kopps.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "LeDuc's", + "url" : "https://leducscustard.com/custard-calendar/", + "script": "./sites/leducs.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Bubba's", + "url" : "https://www.bubbasfrozencustard.com/events", + "script": "./sites/bubbas.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Murf's", + "url" : "http://www.murfsfrozencustard.com/", + "script": "./sites/murfs.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Gille's", + "url" : "https://gillesfrozencustard.com/flavor-of-the-day", + "script": "./sites/gilles.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Brookfield - W Capital Dr", + "url" : "https://www.culvers.com/restaurants/brookfield-capitol", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Robert's", + "url" : "https://robertsfrozencustard.com/", + "script": "./sites/roberts.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Kraverz's", + "url" : "https://www.kraverzcustard.com/FlavorSchedule", + "script": "./sites/kraverz.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Hefner's Frozen Custard", + "url" : "https://www.hefnerscustard.com/", + "script": "./sites/hefners.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Elm Grove - W Bluemound Rd", + "url" : "https://www.culvers.com/restaurants/elm-grove-wi", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Shorewood", + "url" : "https://www.culvers.com/restaurants/shorewood", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Mequon", + "url" : "https://www.culvers.com/restaurants/mequon", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Glendale - Bayside Dr", + "url" : "https://www.culvers.com/restaurants/glendale-wi-bayside-dr", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Milwaukee - W Layton Ave", + "url" : "https://www.culvers.com/restaurants/milwaukee-layton", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: West Milwaukee - Miller Pkwy", + "url" : "https://www.culvers.com/restaurants/west-milwaukee", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: West Allis - S 108th St", + "url" : "https://www.culvers.com/restaurants/west-milwaukee", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Pop's Custard", + "url" : "https://www.popscustard.com/", + "script": "./sites/pops.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Georgie Porgies", + "url" : "https://georgieporgies.com/georgies-flavor-forecast/", + "script": "./sites/georgie.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Golden Gyro", + "url" : "https://goldengyro.com/daily-flavors", + "script": "./sites/goldengyro.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Waukesha, WI - E Main St", + "url" : "https://culvers.com/restaurants/waukesha-hwy-164", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Waukesha, WI - Grandview", + "url" : "https://www.culvers.com/restaurants/waukesha-grandview", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Brookfield - 124th St", + "url" : "https://www.culvers.com/restaurants/brookfield-124th", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: New Berlin - W National Ave", + "url" : "https://www.culvers.com/restaurants/new-berlin", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + }, + { + "name": "Culver's: Milwaukee - Fond Du Lac Ave", + "url" : "https://www.culvers.com/restaurants/milwaukee-fond-du-lac", + "script": "./sites/culvers-brookfield.ts", + "flavorOfTheDay": "", + "locations": [ + { + "latitude": 43.0389, + "longitude": -87.9065 + } + ] + } + ] +} diff --git a/site/index.html b/site/index.html index 8b5716f..c22c013 100644 --- a/site/index.html +++ b/site/index.html @@ -13,35 +13,163 @@ + + +
-
-
- + }); + + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(position => { + const { latitude, longitude } = position.coords; + nearby = sites.filter(site => { + return site.locations.some(location => { + const distance = getDistanceFromLatLonInKm(latitude, longitude, location.latitude, location.longitude); + return distance <= 8.04672; // 5 miles in km + }); + }); + if (nearby.length > 0) { + const nearbyTab = document.getElementById('nearby-tab').click(); + } + }); + } + + function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) { + const R = 6371; // Radius of the earth in km + const dLat = deg2rad(lat2 - lat1); + const dLon = deg2rad(lon2 - lon1); + const a = + Math.sin(dLat/2) * Math.sin(dLat/2) + + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * + Math.sin(dLon/2) * Math.sin(dLon/2) + ; + const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); + const d = R * c; // Distance in km + return d; + } + + function deg2rad(deg) { + return deg * (Math.PI/180) + }"> + +
+
+
+ +
+
+
+ +
+ + +
+
+
+
+ + +
+
-

Last updated:

+ +

Last updated:
Donate | Feedback

+ - \ No newline at end of file + diff --git a/site/templates/index.eta b/site/templates/index.eta index be8530d..2c8576b 100644 --- a/site/templates/index.eta +++ b/site/templates/index.eta @@ -30,7 +30,7 @@
-
+ }); + + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(position => { + const { latitude, longitude } = position.coords; + nearby = sites.filter(site => { + return site.locations.some(location => { + const distance = getDistanceFromLatLonInKm(latitude, longitude, location.latitude, location.longitude); + return distance <= 8.04672; // 5 miles in km + }); + }); + if (nearby.length > 0) { + const nearbyTab = document.getElementById('nearby-tab').click(); + } + }); + } + + function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) { + const R = 6371; // Radius of the earth in km + const dLat = deg2rad(lat2 - lat1); + const dLon = deg2rad(lon2 - lon1); + const a = + Math.sin(dLat/2) * Math.sin(dLat/2) + + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * + Math.sin(dLon/2) * Math.sin(dLon/2) + ; + const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); + const d = R * c; // Distance in km + return d; + } + + function deg2rad(deg) { + return deg * (Math.PI/180) + }">
@@ -102,6 +138,21 @@
+
+
+ + +
+

Last updated:
Donate | Feedback

@@ -119,6 +170,6 @@
- + - \ No newline at end of file + From af630aeb1602b311ed5383d115b174ea2948950d Mon Sep 17 00:00:00 2001 From: jpchapiewsky Date: Sat, 4 Jan 2025 15:48:58 -0600 Subject: [PATCH 2/6] update output.json file --- site/output.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/output.json b/site/output.json index 230e8b2..3bad651 100644 --- a/site/output.json +++ b/site/output.json @@ -1 +1 @@ -{"sites":[{"name":"Oscar's","url":"https://www.oscarscustard.com/index.php/flavors/","script":"./sites/oscars.ts","flavorOfTheDay":"BROWNIE EXPLOSION"}],"lastUpdatedOn":"Fri, 18 Aug 2023 05:32:22 GMT"} \ No newline at end of file +{"sites":[{"name":"Oscar's","url":"https://www.oscarscustard.com/index.php/flavors/","script":"./sites/oscars.ts","flavorOfTheDay":"DRUM…STIXXX!","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Kopp's","url":"https://kopps.com/flavor-preview","script":"./sites/kopps.ts","flavorOfTheDay":" Butter Pecan, Cranapple Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"LeDuc's","url":"https://leducscustard.com/custard-calendar/","script":"./sites/leducs.ts","flavorOfTheDay":" Monkey Tails","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Bubba's","url":"https://www.bubbasfrozencustard.com/events","script":"./sites/bubbas.ts","flavorOfTheDay":"Peanut Butter Cup","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Murf's","url":"http://www.murfsfrozencustard.com/","script":"./sites/murfs.ts","flavorOfTheDay":"Caramel Brownie Fudge","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Gille's","url":"https://gillesfrozencustard.com/flavor-of-the-day","script":"./sites/gilles.ts","flavorOfTheDay":"Closed - Winter Closure","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Brookfield - W Capital Dr","url":"https://www.culvers.com/restaurants/brookfield-capitol","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Robert's","url":"https://robertsfrozencustard.com/","script":"./sites/roberts.ts","flavorOfTheDay":"Chocolate Fudge Oreo!","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Kraverz's","url":"https://www.kraverzcustard.com/FlavorSchedule","script":"./sites/kraverz.ts","flavorOfTheDay":"CARAMEL BROWNIE","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Hefner's Frozen Custard","url":"https://www.hefnerscustard.com/","script":"./sites/hefners.ts","flavorOfTheDay":"Butterfinger","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Elm Grove - W Bluemound Rd","url":"https://www.culvers.com/restaurants/elm-grove-wi","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Double Strawberry","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Shorewood","url":"https://www.culvers.com/restaurants/shorewood","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Crazy for Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Mequon","url":"https://www.culvers.com/restaurants/mequon","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Glendale - Bayside Dr","url":"https://www.culvers.com/restaurants/glendale-wi-bayside-dr","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Milwaukee - W Layton Ave","url":"https://www.culvers.com/restaurants/milwaukee-layton","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Mint Explosion","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: West Milwaukee - Miller Pkwy","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: West Allis - S 108th St","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Pop's Custard","url":"https://www.popscustard.com/","script":"./sites/pops.ts","flavorOfTheDay":"Sweet-N-Salty","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Georgie Porgies","url":"https://georgieporgies.com/georgies-flavor-forecast/","script":"./sites/georgie.ts","flavorOfTheDay":"Choco Berry Dream","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Golden Gyro","url":"https://goldengyro.com/daily-flavors","script":"./sites/goldengyro.ts","flavorOfTheDay":"See website","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Waukesha, WI - E Main St","url":"https://culvers.com/restaurants/waukesha-hwy-164","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Red Raspberry","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Waukesha, WI - Grandview","url":"https://www.culvers.com/restaurants/waukesha-grandview","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Raspberry Cheesecake","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Brookfield - 124th St","url":"https://www.culvers.com/restaurants/brookfield-124th","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Turtle Dove","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: New Berlin - W National Ave","url":"https://www.culvers.com/restaurants/new-berlin","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Really Reese's","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Milwaukee - Fond Du Lac Ave","url":"https://www.culvers.com/restaurants/milwaukee-fond-du-lac","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Chocolate Heath Crunch","locations":[{"latitude":43.0389,"longitude":-87.9065}]}],"lastUpdatedOn":"Sat, 04 Jan 2025 21:42:41 GMT"} \ No newline at end of file From 476c4b5d22a8a7f3ddcaee5e905550dffc7a5375 Mon Sep 17 00:00:00 2001 From: jpchapiewsky Date: Sat, 4 Jan 2025 15:49:15 -0600 Subject: [PATCH 3/6] fix bootstrap cdn --- site/templates/index.eta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/templates/index.eta b/site/templates/index.eta index 2c8576b..e71a7ae 100644 --- a/site/templates/index.eta +++ b/site/templates/index.eta @@ -170,6 +170,6 @@ - + From ef50985a8487d719b85588ba6660cb83c06c2ed6 Mon Sep 17 00:00:00 2001 From: jpchapiewsky Date: Sat, 4 Jan 2025 15:49:46 -0600 Subject: [PATCH 4/6] update deno.lock --- deno.lock | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/deno.lock b/deno.lock index 7bcc312..df04326 100644 --- a/deno.lock +++ b/deno.lock @@ -5,7 +5,47 @@ "https://cdn.skypack.dev/-/strnum@v1.0.5-UZPHteCsFGtQtMgV7Cjq/dist=es2019,mode=imports/optimized/strnum.js": "bf01113a22aa626ca865caf4a07493e2ddf2bcb4dc49e0f5549d0dc0da187bc9", "https://cdn.skypack.dev/fast-xml-parser@3.21.1?dts": "df514c592773a4c36df147b52d1449da2c401c9c7d3c83bf741ce37675b842f8", "https://deno.land/std@0.194.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", + "https://deno.land/std@0.194.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", + "https://deno.land/std@0.194.0/async/abortable.ts": "fd682fa46f3b7b16b4606a5ab52a7ce309434b76f820d3221bdfb862719a15d7", + "https://deno.land/std@0.194.0/async/deadline.ts": "58f72a3cc0fcb731b2cc055ba046f4b5be3349ff6bf98f2e793c3b969354aab2", + "https://deno.land/std@0.194.0/async/debounce.ts": "adab11d04ca38d699444ac8a9d9856b4155e8dda2afd07ce78276c01ea5a4332", + "https://deno.land/std@0.194.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8", + "https://deno.land/std@0.194.0/async/delay.ts": "73aa04cec034c84fc748c7be49bb15cac3dd43a57174bfdb7a4aec22c248f0dd", + "https://deno.land/std@0.194.0/async/mod.ts": "f04344fa21738e5ad6bea37a6bfffd57c617c2d372bb9f9dcfd118a1b622e576", + "https://deno.land/std@0.194.0/async/mux_async_iterator.ts": "70c7f2ee4e9466161350473ad61cac0b9f115cff4c552eaa7ef9d50c4cbb4cc9", + "https://deno.land/std@0.194.0/async/pool.ts": "f1b8d3df4d7fd3c73f8cbc91cc2e8b8e950910f1eab94230b443944d7584c657", + "https://deno.land/std@0.194.0/async/retry.ts": "b1ccf653954a4e52b3d9731e57d18b864e689a7462e78fb20440b11be9905080", + "https://deno.land/std@0.194.0/async/tee.ts": "47e42d35f622650b02234d43803d0383a89eb4387e1b83b5a40106d18ae36757", + "https://deno.land/std@0.194.0/collections/_utils.ts": "5114abc026ddef71207a79609b984614e66a63a4bda17d819d56b0e72c51527e", + "https://deno.land/std@0.194.0/collections/deep_merge.ts": "d4628270ec6325055b95162df05b8543961b6f5b2a56f7cc46b730cc2c7b84ab", + "https://deno.land/std@0.194.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", "https://deno.land/std@0.194.0/flags/mod.ts": "17f444ddbee43c5487568de0c6a076c7729cfe90d96d2ffcd2b8f8adadafb6e8", + "https://deno.land/std@0.194.0/fmt/bytes.ts": "f29cf69e0791d375f9f5d94ae1f0641e5a03b975f32ddf86d70f70fdf37e7b6a", + "https://deno.land/std@0.194.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", + "https://deno.land/std@0.194.0/http/etag.ts": "6ad8abbbb1045aabf2307959a2c5565054a8bf01c9824ddee836b1ff22706a58", + "https://deno.land/std@0.194.0/http/file_server.ts": "2349d927be838b32a965ba435d0e8351932b79186fa582ea2d7168b6b53ba36e", + "https://deno.land/std@0.194.0/http/http_status.ts": "8a7bcfe3ac025199ad804075385e57f63d055b2aed539d943ccc277616d6f932", + "https://deno.land/std@0.194.0/http/server.ts": "1b23463b5b36e4eebc495417f6af47a6f7d52e3294827a1226d2a1aab23d9d20", + "https://deno.land/std@0.194.0/http/util.ts": "4cf044067febaa26d0830e356b0f3a5f76d701a60d7ff7a516fad7b192f4c3a7", + "https://deno.land/std@0.194.0/media_types/_db.ts": "7606d83e31f23ce1a7968cbaee852810c2cf477903a095696cdc62eaab7ce570", + "https://deno.land/std@0.194.0/media_types/_util.ts": "916efbd30b6148a716f110e67a4db29d6949bf4048997b754415dd7e42c52378", + "https://deno.land/std@0.194.0/media_types/content_type.ts": "ad98a5aa2d95f5965b2796072284258710a25e520952376ed432b0937ce743bc", + "https://deno.land/std@0.194.0/media_types/format_media_type.ts": "f5e1073c05526a6f5a516ac5c5587a1abd043bf1039c71cde1166aa4328c8baf", + "https://deno.land/std@0.194.0/media_types/get_charset.ts": "18b88274796fda5d353806bf409eb1d2ddb3f004eb4bd311662c4cdd8ac173db", + "https://deno.land/std@0.194.0/media_types/parse_media_type.ts": "835c4112e1357e95b4f10d7cdea5ae1801967e444f48673ff8f1cb4d32af9920", + "https://deno.land/std@0.194.0/media_types/type_by_extension.ts": "daa801eb0f11cdf199445d0f1b656cf116d47dcf9e5b85cc1e6b4469f5ee0432", + "https://deno.land/std@0.194.0/media_types/vendor/mime-db.v1.52.0.ts": "6925bbcae81ca37241e3f55908d0505724358cda3384eaea707773b2c7e99586", + "https://deno.land/std@0.194.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.194.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.194.0/path/_util.ts": "d7abb1e0dea065f427b89156e28cdeb32b045870acdf865833ba808a73b576d0", + "https://deno.land/std@0.194.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", + "https://deno.land/std@0.194.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1", + "https://deno.land/std@0.194.0/path/mod.ts": "f065032a7189404fdac3ad1a1551a9ac84751d2f25c431e101787846c86c79ef", + "https://deno.land/std@0.194.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d", + "https://deno.land/std@0.194.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", + "https://deno.land/std@0.194.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba", + "https://deno.land/std@0.194.0/streams/byte_slice_stream.ts": "225d57263a34325d7c96cb3dafeb478eec0e6fd05cd0458d678752eadd132bb4", + "https://deno.land/std@0.194.0/version.ts": "04e5fc461ac4ab1f4d2d0bdc814fbbed940319e9939096f4334b1db8216f102d", "https://deno.land/std@0.198.0/collections/filter_values.ts": "16e1fc456a7969e770ec5b89edf5ac97b295ca534b47c1a83f061b409aad7814", "https://deno.land/std@0.198.0/collections/without_all.ts": "1e3cccb1ed0659455b473c0766d9414b7710d8cef48862c899f445178f66b779", "https://deno.land/std@0.198.0/dotenv/load.ts": "0636983549b98f29ab75c9a22a42d9723f0a389ece5498fe971e7bb2556a12e2", @@ -58,6 +98,17 @@ "https://deno.land/std@0.93.0/path/win32.ts": "77f7b3604e0de40f3a7c698e8a79e7f601dc187035a1c21cb1e596666ce112f8", "https://deno.land/x/cache@0.2.12/deps.ts": "f992c28c82770eab287f0ea332eae502e397c78e5f27a0a4512f59dd54dee865", "https://deno.land/x/cache@0.2.12/directories.ts": "ef48531cab3f827252e248596d15cede0de179a2fb15392ae24cf8034519994f", + "https://deno.land/x/eta@v3.0.3/src/compile-string.ts": "e919c1a5e2cf460dbbd93047ab3548a630e5eb5c7fa019335c08e95b50e86cd7", + "https://deno.land/x/eta@v3.0.3/src/compile.ts": "146782227ddd5c423d07dedb2be40a2a5643c7429d9a3af5ac9a79c21bf7ae95", + "https://deno.land/x/eta@v3.0.3/src/config.ts": "7e2971ba3ec4b31b5f1ae0ea71957f0a2b868285192be77836d65ca27adb4f90", + "https://deno.land/x/eta@v3.0.3/src/core.ts": "53a9a10c8fc06ce88155a125ffb7db724afb7b4e16d6f646b20a29f27baa2cdf", + "https://deno.land/x/eta@v3.0.3/src/err.ts": "e9732b5f7fe729fed9d67868ff7d87ef1002d45d0a8a4e8f7fb1fa9ec2e2d50b", + "https://deno.land/x/eta@v3.0.3/src/file-handling.ts": "ac54a84c4e73f47629d69725b8557080caf4e03cf34413b4a2a3f3a10c0abb25", + "https://deno.land/x/eta@v3.0.3/src/index.ts": "fa1e18db556462293408c7a455b05b5253aae460c97811f88bb023cdc3f95f62", + "https://deno.land/x/eta@v3.0.3/src/parse.ts": "8cb25b4ccf58ea7f08fe9835f7eb8bf45917d6d743d28d1e25cadc9fc908cb32", + "https://deno.land/x/eta@v3.0.3/src/render.ts": "bfd57548d5fdae11c1c1683ff748783c1f85be3db3c24fcc80ce915692b004dd", + "https://deno.land/x/eta@v3.0.3/src/storage.ts": "c40bd31cdd6f1218c86f70067282709e2f2c7fa7eea67547be950e1ed5d4bd4c", + "https://deno.land/x/eta@v3.0.3/src/utils.ts": "1994c8d228195558fb6785fb00a97cf21a457df598a6ab1945170f7a4b7f00d9", "https://deno.land/x/puppeteer@16.2.0/mod.ts": "52a47aa1850fc0a8255d6c8c462f4ab7e43104d342e6de7bda334221ca8bdcac", "https://deno.land/x/puppeteer@16.2.0/src/deno/BrowserFetcher.ts": "6be7a586667b429138994a4955b2339fc58af9b6d08378672c8a2b052045e308", "https://deno.land/x/puppeteer@16.2.0/src/deno/BrowserRunner.ts": "a32b6d2df712afce5f0707aabb6fbcd1e9b1b20e90fc5c34daa081960a638e62", From c11d1ee6835ee6926431fc8b9553d63eb13837ff Mon Sep 17 00:00:00 2001 From: jpchapiewsky Date: Sat, 4 Jan 2025 19:42:20 -0600 Subject: [PATCH 5/6] update lat long in sites.json --- importer/sites.json | 169 +++++++++++++++++++++------------------ site/output.json | 2 +- site/templates/index.eta | 30 +++---- 3 files changed, 109 insertions(+), 92 deletions(-) diff --git a/importer/sites.json b/importer/sites.json index 0122830..666ac0e 100644 --- a/importer/sites.json +++ b/importer/sites.json @@ -1,304 +1,319 @@ { - "sites" : [ + "sites": [ { "name": "Oscar's", - "url" : "https://www.oscarscustard.com/index.php/flavors/", + "url": "https://www.oscarscustard.com/index.php/flavors/", "script": "./sites/oscars.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0319834, + "longitude": -88.1759439 + }, + { + "latitude": 43.0010124, + "longitude": -88.0465273 + },{ + "latitude": 42.9174115, + "longitude": -87.9506804 } ] }, { "name": "Kopp's", - "url" : "https://kopps.com/flavor-preview", + "url": "https://kopps.com/flavor-preview", "script": "./sites/kopps.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0367327, + "longitude": -88.1476399 + }, + { + "latitude": 42.9586554, + "longitude": -88.0092673 + }, + { + "latitude": 43.1146779, + "longitude": -87.9173067 } ] }, { "name": "LeDuc's", - "url" : "https://leducscustard.com/custard-calendar/", + "url": "https://leducscustard.com/custard-calendar/", "script": "./sites/leducs.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0126154, + "longitude": -88.3824595 } ] }, { "name": "Bubba's", - "url" : "https://www.bubbasfrozencustard.com/events", + "url": "https://www.bubbasfrozencustard.com/events", "script": "./sites/bubbas.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0826589, + "longitude": -88.2357593 } ] }, { "name": "Murf's", - "url" : "http://www.murfsfrozencustard.com/", + "url": "http://www.murfsfrozencustard.com/", "script": "./sites/murfs.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0894, + "longitude": -87.9876 } ] }, { "name": "Gille's", - "url" : "https://gillesfrozencustard.com/flavor-of-the-day", + "url": "https://gillesfrozencustard.com/flavor-of-the-day", "script": "./sites/gilles.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0349924, + "longitude": -88.00658 } ] }, { "name": "Culver's: Brookfield - W Capital Dr", - "url" : "https://www.culvers.com/restaurants/brookfield-capitol", + "url": "https://www.culvers.com/restaurants/brookfield-capitol", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0841823, + "longitude": -88.1774279 } ] }, { "name": "Robert's", - "url" : "https://robertsfrozencustard.com/", + "url": "https://robertsfrozencustard.com/", "script": "./sites/roberts.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.2214898, + "longitude": -88.1085062 } ] }, { "name": "Kraverz's", - "url" : "https://www.kraverzcustard.com/FlavorSchedule", + "url": "https://www.kraverzcustard.com/FlavorSchedule", "script": "./sites/kraverz.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.1777451, + "longitude": -88.100238 } ] }, { "name": "Hefner's Frozen Custard", - "url" : "https://www.hefnerscustard.com/", + "url": "https://www.hefnerscustard.com/", "script": "./sites/hefners.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.3019119, + "longitude": -87.9749162 } ] }, { "name": "Culver's: Elm Grove - W Bluemound Rd", - "url" : "https://www.culvers.com/restaurants/elm-grove-wi", + "url": "https://www.culvers.com/restaurants/elm-grove-wi", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0365135, + "longitude": -88.1038986 } ] }, { "name": "Culver's: Shorewood", - "url" : "https://www.culvers.com/restaurants/shorewood", + "url": "https://www.culvers.com/restaurants/shorewood", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0886792, + "longitude": -87.894209 } ] }, { "name": "Culver's: Mequon", - "url" : "https://www.culvers.com/restaurants/mequon", + "url": "https://www.culvers.com/restaurants/mequon", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.2205244, + "longitude": -87.9233456 } ] }, { "name": "Culver's: Glendale - Bayside Dr", - "url" : "https://www.culvers.com/restaurants/glendale-wi-bayside-dr", + "url": "https://www.culvers.com/restaurants/glendale-wi-bayside-dr", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.1243531, + "longitude": -87.9127428 } ] }, { "name": "Culver's: Milwaukee - W Layton Ave", - "url" : "https://www.culvers.com/restaurants/milwaukee-layton", + "url": "https://www.culvers.com/restaurants/milwaukee-layton", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 42.9586069, + "longitude": -87.9189752 } ] }, { "name": "Culver's: West Milwaukee - Miller Pkwy", - "url" : "https://www.culvers.com/restaurants/west-milwaukee", + "url": "https://www.culvers.com/restaurants/west-milwaukee", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0131316, + "longitude": -87.9682445 } ] }, { "name": "Culver's: West Allis - S 108th St", - "url" : "https://www.culvers.com/restaurants/west-milwaukee", + "url": "https://www.culvers.com/restaurants/west-milwaukee", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.011852, + "longitude": -88.0458024 } ] }, { "name": "Pop's Custard", - "url" : "https://www.popscustard.com/", + "url": "https://www.popscustard.com/", "script": "./sites/pops.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.1755506, + "longitude": -88.1142974 } ] }, { "name": "Georgie Porgies", - "url" : "https://georgieporgies.com/georgies-flavor-forecast/", + "url": "https://georgieporgies.com/georgies-flavor-forecast/", "script": "./sites/georgie.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 42.8707166, + "longitude": -87.9146235 } ] }, { "name": "Golden Gyro", - "url" : "https://goldengyro.com/daily-flavors", + "url": "https://goldengyro.com/daily-flavors", "script": "./sites/goldengyro.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0026091, + "longitude": -88.003716 } ] }, { "name": "Culver's: Waukesha, WI - E Main St", - "url" : "https://culvers.com/restaurants/waukesha-hwy-164", + "url": "https://culvers.com/restaurants/waukesha-hwy-164", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0225821, + "longitude": -88.2018863 } ] }, { "name": "Culver's: Waukesha, WI - Grandview", - "url" : "https://www.culvers.com/restaurants/waukesha-grandview", + "url": "https://www.culvers.com/restaurants/waukesha-grandview", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0397092, + "longitude": -88.2563884 } ] }, { "name": "Culver's: Brookfield - 124th St", - "url" : "https://www.culvers.com/restaurants/brookfield-124th", + "url": "https://www.culvers.com/restaurants/brookfield-124th", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0855263, + "longitude": -88.0669907 } ] }, { "name": "Culver's: New Berlin - W National Ave", - "url" : "https://www.culvers.com/restaurants/new-berlin", + "url": "https://www.culvers.com/restaurants/new-berlin", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 42.9825317, + "longitude": -88.0987385 } ] }, { "name": "Culver's: Milwaukee - Fond Du Lac Ave", - "url" : "https://www.culvers.com/restaurants/milwaukee-fond-du-lac", + "url": "https://www.culvers.com/restaurants/milwaukee-fond-du-lac", "script": "./sites/culvers-brookfield.ts", "flavorOfTheDay": "", "locations": [ { - "latitude": 43.0389, - "longitude": -87.9065 + "latitude": 43.0941812, + "longitude": -87.9827186 } ] } ] -} +} \ No newline at end of file diff --git a/site/output.json b/site/output.json index 3bad651..9d45d5c 100644 --- a/site/output.json +++ b/site/output.json @@ -1 +1 @@ -{"sites":[{"name":"Oscar's","url":"https://www.oscarscustard.com/index.php/flavors/","script":"./sites/oscars.ts","flavorOfTheDay":"DRUM…STIXXX!","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Kopp's","url":"https://kopps.com/flavor-preview","script":"./sites/kopps.ts","flavorOfTheDay":" Butter Pecan, Cranapple Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"LeDuc's","url":"https://leducscustard.com/custard-calendar/","script":"./sites/leducs.ts","flavorOfTheDay":" Monkey Tails","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Bubba's","url":"https://www.bubbasfrozencustard.com/events","script":"./sites/bubbas.ts","flavorOfTheDay":"Peanut Butter Cup","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Murf's","url":"http://www.murfsfrozencustard.com/","script":"./sites/murfs.ts","flavorOfTheDay":"Caramel Brownie Fudge","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Gille's","url":"https://gillesfrozencustard.com/flavor-of-the-day","script":"./sites/gilles.ts","flavorOfTheDay":"Closed - Winter Closure","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Brookfield - W Capital Dr","url":"https://www.culvers.com/restaurants/brookfield-capitol","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Robert's","url":"https://robertsfrozencustard.com/","script":"./sites/roberts.ts","flavorOfTheDay":"Chocolate Fudge Oreo!","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Kraverz's","url":"https://www.kraverzcustard.com/FlavorSchedule","script":"./sites/kraverz.ts","flavorOfTheDay":"CARAMEL BROWNIE","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Hefner's Frozen Custard","url":"https://www.hefnerscustard.com/","script":"./sites/hefners.ts","flavorOfTheDay":"Butterfinger","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Elm Grove - W Bluemound Rd","url":"https://www.culvers.com/restaurants/elm-grove-wi","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Double Strawberry","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Shorewood","url":"https://www.culvers.com/restaurants/shorewood","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Crazy for Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Mequon","url":"https://www.culvers.com/restaurants/mequon","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Glendale - Bayside Dr","url":"https://www.culvers.com/restaurants/glendale-wi-bayside-dr","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Milwaukee - W Layton Ave","url":"https://www.culvers.com/restaurants/milwaukee-layton","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Mint Explosion","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: West Milwaukee - Miller Pkwy","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: West Allis - S 108th St","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Pop's Custard","url":"https://www.popscustard.com/","script":"./sites/pops.ts","flavorOfTheDay":"Sweet-N-Salty","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Georgie Porgies","url":"https://georgieporgies.com/georgies-flavor-forecast/","script":"./sites/georgie.ts","flavorOfTheDay":"Choco Berry Dream","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Golden Gyro","url":"https://goldengyro.com/daily-flavors","script":"./sites/goldengyro.ts","flavorOfTheDay":"See website","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Waukesha, WI - E Main St","url":"https://culvers.com/restaurants/waukesha-hwy-164","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Red Raspberry","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Waukesha, WI - Grandview","url":"https://www.culvers.com/restaurants/waukesha-grandview","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Raspberry Cheesecake","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Brookfield - 124th St","url":"https://www.culvers.com/restaurants/brookfield-124th","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Turtle Dove","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: New Berlin - W National Ave","url":"https://www.culvers.com/restaurants/new-berlin","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Really Reese's","locations":[{"latitude":43.0389,"longitude":-87.9065}]},{"name":"Culver's: Milwaukee - Fond Du Lac Ave","url":"https://www.culvers.com/restaurants/milwaukee-fond-du-lac","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Chocolate Heath Crunch","locations":[{"latitude":43.0389,"longitude":-87.9065}]}],"lastUpdatedOn":"Sat, 04 Jan 2025 21:42:41 GMT"} \ No newline at end of file +{"sites":[{"name":"Oscar's","url":"https://www.oscarscustard.com/index.php/flavors/","script":"./sites/oscars.ts","flavorOfTheDay":"DRUM…STIXXX!","locations":[{"latitude":43.0319834,"longitude":-88.1759439},{"latitude":43.0010124,"longitude":-88.0465273},{"latitude":42.9174115,"longitude":-87.9506804}]},{"name":"Kopp's","url":"https://kopps.com/flavor-preview","script":"./sites/kopps.ts","flavorOfTheDay":" Butter Pecan, Cranapple Crumble","locations":[{"latitude":43.0367327,"longitude":-88.1476399},{"latitude":42.9586554,"longitude":-88.0092673},{"latitude":43.1146779,"longitude":-87.9173067}]},{"name":"LeDuc's","url":"https://leducscustard.com/custard-calendar/","script":"./sites/leducs.ts","flavorOfTheDay":" Monkey Tails","locations":[{"latitude":43.0126154,"longitude":-88.3824595}]},{"name":"Bubba's","url":"https://www.bubbasfrozencustard.com/events","script":"./sites/bubbas.ts","flavorOfTheDay":"Peanut Butter Cup","locations":[{"latitude":43.0826589,"longitude":-88.2357593}]},{"name":"Murf's","url":"http://www.murfsfrozencustard.com/","script":"./sites/murfs.ts","flavorOfTheDay":"Caramel Brownie Fudge","locations":[{"latitude":43.0894,"longitude":-87.9876}]},{"name":"Gille's","url":"https://gillesfrozencustard.com/flavor-of-the-day","script":"./sites/gilles.ts","flavorOfTheDay":"Closed - Winter Closure","locations":[{"latitude":43.0349924,"longitude":-88.00658}]},{"name":"Culver's: Brookfield - W Capital Dr","url":"https://www.culvers.com/restaurants/brookfield-capitol","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0841823,"longitude":-88.1774279}]},{"name":"Robert's","url":"https://robertsfrozencustard.com/","script":"./sites/roberts.ts","flavorOfTheDay":"Chocolate Fudge Oreo!","locations":[{"latitude":43.2214898,"longitude":-88.1085062}]},{"name":"Kraverz's","url":"https://www.kraverzcustard.com/FlavorSchedule","script":"./sites/kraverz.ts","flavorOfTheDay":"CARAMEL BROWNIE","locations":[{"latitude":43.1777451,"longitude":-88.100238}]},{"name":"Hefner's Frozen Custard","url":"https://www.hefnerscustard.com/","script":"./sites/hefners.ts","flavorOfTheDay":"Butterfinger","locations":[{"latitude":43.3019119,"longitude":-87.9749162}]},{"name":"Culver's: Elm Grove - W Bluemound Rd","url":"https://www.culvers.com/restaurants/elm-grove-wi","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.0365135,"longitude":-88.1038986}]},{"name":"Culver's: Shorewood","url":"https://www.culvers.com/restaurants/shorewood","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Crazy for Cookie Dough","locations":[{"latitude":43.0886792,"longitude":-87.894209}]},{"name":"Culver's: Mequon","url":"https://www.culvers.com/restaurants/mequon","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.2205244,"longitude":-87.9233456}]},{"name":"Culver's: Glendale - Bayside Dr","url":"https://www.culvers.com/restaurants/glendale-wi-bayside-dr","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Caramel Fudge Cookie Dough","locations":[{"latitude":43.1243531,"longitude":-87.9127428}]},{"name":"Culver's: Milwaukee - W Layton Ave","url":"https://www.culvers.com/restaurants/milwaukee-layton","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Mint Explosion","locations":[{"latitude":42.9586069,"longitude":-87.9189752}]},{"name":"Culver's: West Milwaukee - Miller Pkwy","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.0131316,"longitude":-87.9682445}]},{"name":"Culver's: West Allis - S 108th St","url":"https://www.culvers.com/restaurants/west-milwaukee","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Creamy Lemon Crumble","locations":[{"latitude":43.011852,"longitude":-88.0458024}]},{"name":"Pop's Custard","url":"https://www.popscustard.com/","script":"./sites/pops.ts","flavorOfTheDay":"Sweet-N-Salty","locations":[{"latitude":43.1755506,"longitude":-88.1142974}]},{"name":"Georgie Porgies","url":"https://georgieporgies.com/georgies-flavor-forecast/","script":"./sites/georgie.ts","flavorOfTheDay":"Choco Berry Dream","locations":[{"latitude":42.8707166,"longitude":-87.9146235}]},{"name":"Golden Gyro","url":"https://goldengyro.com/daily-flavors","script":"./sites/goldengyro.ts","flavorOfTheDay":"See website","locations":[{"latitude":43.0026091,"longitude":-88.003716}]},{"name":"Culver's: Waukesha, WI - E Main St","url":"https://culvers.com/restaurants/waukesha-hwy-164","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Red Raspberry","locations":[{"latitude":43.0225821,"longitude":-88.2018863}]},{"name":"Culver's: Waukesha, WI - Grandview","url":"https://www.culvers.com/restaurants/waukesha-grandview","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Raspberry Cheesecake","locations":[{"latitude":43.0397092,"longitude":-88.2563884}]},{"name":"Culver's: Brookfield - 124th St","url":"https://www.culvers.com/restaurants/brookfield-124th","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Turtle Dove","locations":[{"latitude":43.0855263,"longitude":-88.0669907}]},{"name":"Culver's: New Berlin - W National Ave","url":"https://www.culvers.com/restaurants/new-berlin","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"Turtle","locations":[{"latitude":42.9825317,"longitude":-88.0987385}]},{"name":"Culver's: Milwaukee - Fond Du Lac Ave","url":"https://www.culvers.com/restaurants/milwaukee-fond-du-lac","script":"./sites/culvers-brookfield.ts","flavorOfTheDay":"See website","locations":[{"latitude":43.0941812,"longitude":-87.9827186}]}],"lastUpdatedOn":"Sun, 05 Jan 2025 01:35:41 GMT"} \ No newline at end of file diff --git a/site/templates/index.eta b/site/templates/index.eta index e71a7ae..2e89e0f 100644 --- a/site/templates/index.eta +++ b/site/templates/index.eta @@ -54,23 +54,25 @@ const homeTab = document.getElementById('home-tab').click(); } + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(position => { + const { latitude, longitude } = position.coords; + nearby = sites.filter(site => { + if (site.locations && site.locations.length > 0) { + return site.locations.some(location => { + const distance = getDistanceFromLatLonInKm(latitude, longitude, location.latitude, location.longitude); + return distance <= 8.04672; // 5 miles in km + }); + } + return false; + }); + }); + } + lastUpdatedOn = new Date(r.data.lastUpdatedOn).toLocaleString(); }); - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(position => { - const { latitude, longitude } = position.coords; - nearby = sites.filter(site => { - return site.locations.some(location => { - const distance = getDistanceFromLatLonInKm(latitude, longitude, location.latitude, location.longitude); - return distance <= 8.04672; // 5 miles in km - }); - }); - if (nearby.length > 0) { - const nearbyTab = document.getElementById('nearby-tab').click(); - } - }); - } + function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) { const R = 6371; // Radius of the earth in km From aace03661a1d5f92989f55951564a8ba50d577f9 Mon Sep 17 00:00:00 2001 From: jpchapiewsky Date: Sat, 4 Jan 2025 20:48:01 -0600 Subject: [PATCH 6/6] update Site interface --- importer/importer.interface.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/importer/importer.interface.ts b/importer/importer.interface.ts index aae0ea7..381c614 100644 --- a/importer/importer.interface.ts +++ b/importer/importer.interface.ts @@ -1,12 +1,16 @@ -import { Browser } from "https://deno.land/x/puppeteer@16.2.0/vendor/puppeteer-core/puppeteer/common/Browser.js"; - -export declare namespace MkeFrozenTreatsImporter { - interface Site { - name: string, - url: string, - script: string, - flavorOfTheDay: string - } - - type LoadFunction = (browser: Browser, site: MkeFrozenTreatsImporter.Site) => string; +import { Browser } from "https://deno.land/x/puppeteer@16.2.0/vendor/puppeteer-core/puppeteer/common/Browser.js"; + +export declare namespace MkeFrozenTreatsImporter { + interface Site { + name: string, + url: string, + script: string, + flavorOfTheDay: string, + locations: { + latitude: number, + longitude: number + }[] + } + + type LoadFunction = (browser: Browser, site: MkeFrozenTreatsImporter.Site) => string; } \ No newline at end of file