We were so impressed by the work that @tkompare did on his Chicago Flu Shots web application for the 2013 flu season, that we decided to fork and improve upon it for the 2014 season. Our version has two big changes:
- Instead of being based on Google Fusion Tables, it's instead powered by a Socrata Open Data API.
- It's been simplified and improved for easy deployment on Github Pages
Given data about the location and hours of flu shot providers in your area, this application will help you locate the nearest place you can get the flu vaccine. It will even use geolocation in your browser to help find the nearest provider to your current location.
The app is built on Github Pages and makes use of Jekyll to plumb configuration variables into various places on the app, so its easy to redeploy a customized version of the Flu Shot Finder without writing any new code.
- Fork the repo on Github so that you have your own copy to work with.
- Locate data about the location of flu shot providers in your area. Hopefully, your local or state government has already provided this data, but if not, you can learn more about data hosting below.
- If your data is already compliant with the schema below, you'll be able to use the app mostly without modifications. However, you'll still need to update the config in
_config.yml
. For details on how to configure the app, see "Configuration Options" below. - If your data isn't compliant with the schema below, or if you need to data cleanup on the fly, you can remap your data schema in
js/main.js:93
. In our example, we've done some cleanup of our own, setting default start and end dates and times for locations that haven't provided their own. You can tweak that code to address any issues you've got with your data schema and contents.
- If your data is already compliant with the schema below, you'll be able to use the app mostly without modifications. However, you'll still need to update the config in
- Commit and push your updated code to your fork.
Within a few minutes, your app will be available at http://yourusername.github.io/flushots! Using Github Pages' custom domain name functionality, you can also put it at a domain of your choosing.
In _config.yml
, you'll find a number of configuration options you'll need to update for your deployment:
gmaps_api_key
- Replace the Google Maps API key with your own keytitle
- The name of your instance of the applicationlogo
- The path to your logo image within the repository, or a full URL if hosted elsewherelocality
- The city, county, or state name for your appflu_info_link
- Where visitors can find additional information about the incidence of flu in your areastart_latitude
- The latitude of the start point that the app should center on when first loadingstart_longitude
- The longitude of the start point that the app should center on when first loadingstate
- The state name for your deployment, used for geocoding where a state wasn't provided by the userapi_endpoint
- The API Endpoint for the dataset API providing your datasocrata_app_token
- The Socrata App Token that you've registered for your applicationabout
- The Markdown-formatted about text to be displayed when clicking on the site logo
facility_name
- The name of the facility providing the vaccinationsbegin_date
- The begin date for a timeframe for when the facility will be open for vaccinations. (M/d/yyyy e.g. "1/4/1982")begin_time
- The start time (example: 9:00:00) for when the facility will be open for vaccinations. (hh:mm:ss e.g. "12:00:00")contact
- A contact name listed for the facilitycost
- Vaccination costs. For example, "No cost to individual. If insured, insurance will be billed."end_date
- The end date for a timeframe for when the facility will be open for vaccinations. (M/d/yyyy e.g. "1/4/1982")end_time
- The end time for when the facility will be open for vaccinations. (hh:mm:ss e.g. "12:00:00")hours
- List the hours for when the facility will be open. For example, Mon-Fri: 9:00 AM-9:00 PM, Sat: 9:00 AM-5:00 PM"id
- Assign an unique numeric value for each rowlatitude
- The latitude value for the location of the facilitylongitude
- The longitude value for the location of the facilitynotes
- Additional notes. For example, "Free to individual. Insurance will be billed. Closed 2nd Wed every month 12 to 4 PM"phone
- The phone number for the facility providing the vaccinationsrecurrence_days
- The days of the week the facility is open between the begin_date and end_date. A comma-separated list is required. For example, "Sunday, Monday, Tuesday, Wednesday, Thursday"url
- An unique url assocated with the vaccinations for a specific locationstreet1
- Primary street address of the facility. For example, "7811 S Rachine Ave"street2
- Secondary street address of the facility. For example, "2nd Floor"city
- The city where the facility is locatedstate
- The state where the facility is locatedpostal_code
- The zip code where the facility is located
If vaccine provider data is not provided by your local government on Socrata, do not despair! There are other options available as well.
- If you're a local community group, free hosting is available via the Socrata Community Data Platform. Your organization can sign up and be granted an account that'll allow you to upload your data to Socrata and self-host your own API.
- If you're a Code for America Brigade, you can also sign up for free hosting on the Brigade Open Data Sharing Platform.
We warmly welcome pull requests, so if there are modifications or improvements you'd like to make, feel free to fork this repo and send them our way! Please note that we may modify your pull requests to make sure they work properly with the main fork of the app.
This is sample code provided by Socrata. No warranties or guaranties of any kind are granted. The code is licensed under the MIT License, so have at it!