Coder Social home page Coder Social logo

abdullah50053 / my-reps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datamade/my-reps

0.0 0.0 0.0 344 KB

:busts_in_silhouette: Enter your address to find your elected representatives. Powered by the Google Civic Information API

Home Page: https://myreps.datamade.us

License: MIT License

JavaScript 61.33% Ruby 2.24% CSS 1.44% HTML 34.99%

my-reps's Introduction

My Reps

My Reps helps you locate and contact your federal, state, county and local elected representatives. Based on my-reps-pbp by DataMade and Participatory Budgeting Project. Powered by the Google Civic Information API.

For more, read our launch blog post: "We find your reps so you don't have to".

Custom installations: If you would like assistance setting up a customized version of this tool, contact DataMade: [email protected]

My Reps

Organizers: reuse our code!

We built this tool to be open source and easy to repurpose. Feel free to copy, reuse, and customize the My Reps codebase.

Here's how to do it:

1. Fork this repository

Click the 'Fork' button in the upper right corner of this page to copy it to your GitHub account.

Fork this repo

2. Clone this project to your local computer

Next, you can clone it to your local computer (requires the command line):

git clone [email protected]:your-name-here/my-reps.git
cd my-reps

You can use GitHub Desktop instead if you are not familiar with the command line.

3. Add your Google API key

For the address search, map and representative lookup to work, you'll need to get a Google API key. You can get yours and enable it by following these instructions: https://developers.google.com/maps/documentation/javascript/get-api-key

You'll need to make sure that you enable the following API services from Google:

  • Geocoding API
  • Geolocation API
  • Maps Javascript API
  • Google Civic Information API
  • Places API

Read Google's instructions on how to enable these services: https://support.google.com/googleapi/answer/6158841?hl=en

When you get a key, set the google_api_key in _config.yml.

port:  5000
markdown: kramdown
name: "My Reps"

...

google_api_key: YOUR API KEY GOES HERE

4. Modify the index.html and /js/lookup_tool.js files as needed

Some examples of things you can do:

Customize the messaging

First, create a new tagline in the _layouts/default.html page.

<div class='text-center'>
    <h1><a href='index.html'>My Reps</a></h1>
    <!-- Update this tagline! -->
    <p class='lead'>Enter your address to <strong>find and contact</strong> your federal, state, county and local elected representatives</p>
</div>

Then, add text to the top of the index.html page.

---
layout: default
---

<p class='text-center'>This is my call to action. Let's do something about it!</p>

<div class="row">
...

Change the instructions in the 'contact' popup for each representative

You can change the text that displays when you click the 'Contact' button next to each representative. Go to the modalGuts section in index.html and look for 'Add your contact instructions here!'.

Note that we're using EJS templates for this part, so mind the template tags.

Limit your results to specific levels of government (local, county, state & federal)

In js/lookup_tool.js you can toggle if you want to show federal, state, county and local government representatives.

var show_federal = true; //change this to false to hide federal results
var show_state   = true;
var show_county  = true;
var show_local   = true;

5. Run it

This website is built using Jekyll. You will need to install it first.

jekyll serve -w

Then, open your web browser and navigate to http://localhost:5000

6. Deploy it with GitHub pages

GitHub pages You can host your table on GitHub pages for free! Once you've made all your changes and committed them, push everything in the master branch to gh-pages, which automatically enables GitHub pages.

git push origin master:gh-pages

Then navigate to http://your-github-username.github.io/my-reps/

Read more on working with GitHub pages projects.

7. Add it as an iframe on your site (optional)

Want to embed your nifty table on your website? You can use an iframe. Once you've deployed your table (above in step 5) you can link to it in an iframe right in your HTML.

Here's an example:

<iframe style="border-style: none;" src="https://datamade.github.io/my-reps/" height="950" width="600"></iframe>

If you need professional assistance, contact DataMade at [email protected]

Reporting outdated or missing information

Information on elected officials comes from the Google Civic Information API, which aggregates data across the United States on elected officials in federal, state, county and local government offices.

Sometimes data is outdated or missing. If you notice an issue with the data, please report it to Google.

Web dependencies

Data comes from the Google Civic Information API.

We used the following open source tools:

Team

  • Derek Eder - developer, content
  • Eric van Zanten - developer

Errors and Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/my-reps/issues

Note on Patches and Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Send a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2016 DataMade. Released under the MIT License.

my-reps's People

Contributors

derekeder avatar reginafcompton avatar evz avatar mroswell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.