Skip to content
This repository has been archived by the owner on Jan 31, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
99littlebugs committed Jan 17, 2021
2 parents 3523d8e + 32e4a47 commit 4b6bb66
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 98 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/

# should be generated
site/index.html
site/images/social-share.png
14 changes: 14 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const handlebars = require('handlebars');
const fs = require("fs");
const path = require('path');
const puppeteer = require('puppeteer');

handlebars.registerHelper('date', function (date) {
const options = { weekday: 'short', month: 'short', day: 'numeric' };
Expand All @@ -26,6 +27,19 @@ for (const site of data.sites) {

fs.writeFileSync(path.join("site", "index.html"), template({ sites: sites.sort(sortByProperty("name")), events: events.sort(sortByProperty("date")) }));

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({
width: 1200,
height: 628,
deviceScaleFactor: 1
});
await page.goto(`file://${path.join(__dirname, "site", "index.html")}`);
await page.screenshot({path: path.join("site", "images", "social-share.png")});
await browser.close();
})();

function sortByProperty(property) {
return function (a, b) {
if (a[property] > b[property])
Expand Down
99 changes: 3 additions & 96 deletions data/ny_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,68 +70,7 @@
"state": "NY",
"zip": "10018"
},
"events": [
{
"date": "2021-01-17T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "2",
"linkId": "Marker0Div"
},
{
"date": "2021-01-28T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker1Div"
},
{
"date": "2021-02-10T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "2",
"linkId": "Marker2Div"
},
{
"date": "2021-02-16T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker3Div"
},
{
"date": "2021-02-25T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker4Div"
},
{
"date": "2021-02-27T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker5Div"
},
{
"date": "2021-03-08T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker6Div"
},
{
"date": "2021-03-09T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker7Div"
},
{
"date": "2021-03-31T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker8Div"
},
{
"date": "2021-04-15T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker9Div"
}
]
"events": []
},
{
"name": "Northwell CoVID-19 Vaccination Program: Manhattan - Lenox Hill Hospital",
Expand Down Expand Up @@ -179,20 +118,7 @@
"state": "NY",
"zip": "11793"
},
"events": [
{
"date": "2021-01-20T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker1Div"
},
{
"date": "2021-03-29T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker2Div"
}
]
"events": []
},
{
"name": "NYS COVID Vaccine POD - Westchester County Center",
Expand All @@ -204,26 +130,7 @@
"state": "NY",
"zip": "10607"
},
"events": [
{
"date": "2021-03-22T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker1Div"
},
{
"date": "2021-03-24T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker2Div"
},
{
"date": "2021-04-10T00:00:00.000Z",
"time": "08:00:00.0 - 18:30:00.0",
"appointments": "1",
"linkId": "Marker3Div"
}
]
"events": []
}
]
}
Binary file removed site/images/vaccine-site-finder.png
Binary file not shown.
4 changes: 2 additions & 2 deletions site/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Font -->
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">

<!-- CSS -->
<link rel="stylesheet" href="css/normalize.css">
Expand All @@ -34,7 +34,7 @@
<meta property="og:title" content="COVID-19 Vaccine Site Finder">
<meta property="og:description" content="NY State vaccination appointments seem to be spread across multiple websites, making it challenging to see where appointments are available.
This website aims to solve that problem by aggregating the views of the many different sites to a single dashboard.">
<meta property="og:image" content="https://vaccinesitefinder.com/images/vaccine-site-finder.png">
<meta property="og:image" content="https://vaccinesitefinder.com/images/social-share.png">
<meta property="og:url" content="https://vaccinesitefinder.com">
<meta name="twitter:card" content="summary_large_image">
</head>
Expand Down

0 comments on commit 4b6bb66

Please sign in to comment.