{"id":19124071,"url":"https://github.com/efforg/congress_forms","last_synced_at":"2025-05-05T19:00:11.730Z","repository":{"id":62556155,"uuid":"150142986","full_name":"EFForg/congress_forms","owner":"EFForg","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-09T18:12:27.000Z","size":74,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-19T11:09:06.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EFForg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-24T17:39:22.000Z","updated_at":"2025-04-09T18:12:30.000Z","dependencies_parsed_at":"2024-11-09T05:28:20.632Z","dependency_job_id":"7b1d3217-e5ea-4a42-9809-3de61e494341","html_url":"https://github.com/EFForg/congress_forms","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":0.06779661016949157,"last_synced_commit":"fa711f8afb3bc7787e615ee6e8338a48c839cebf"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFForg%2Fcongress_forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFForg%2Fcongress_forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFForg%2Fcongress_forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFForg%2Fcongress_forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EFForg","download_url":"https://codeload.github.com/EFForg/congress_forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252558660,"owners_count":21767806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T05:28:03.994Z","updated_at":"2025-05-05T19:00:11.694Z","avatar_url":"https://github.com/EFForg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CongressForms\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'congress_forms'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install congress_forms\n\n\n### Program Dependencies\n\n  * google-chrome, git\n  * ruby \u003e= 3.0\n\n\n## Usage\n\nTo send a message to Congress, begin by creating a form object. Senators should be identified by their [BioGuide ID](https://www.congress.gov/help/field-values/member-bioguide-ids), while Representatives are identified by an office code H*XXYY*, where XX is their state and YY is their district.\n\n```ruby\n# Form for Senator Kamala Harris (BioGuide H001075)\nCongressForms::Form.find(\"H001075\")\n\n# Form for CA-13 Represenative Barbara Lee (office code HCA13)\nCongressForms::Form.find(\"HCA13\")\n```\n\nEach Senator's office may require different fields, provide different options for select menus, etc. You can query the fields required by a particular form by calling `CongressForms::Form#required_params`.\n\n```ruby\n# List required message parameters\nirb(main)\u003e CongressForms::Form.find(\"H001075\").required_params\n[\n  # Required text fields\n  { :value =\u003e \"$NAME_FIRST\", :max_length =\u003e nil },\n  { :value =\u003e \"$NAME_LAST\", :max_length =\u003e nil },\n\n  # Required multiple choice field\n  { :value =\u003e \"$NAME_PREFIX\", :options =\u003e [\"Mr.\", \"Ms.\", \"Mrs.\", ...] },\n\n  # Required multiple choice field with distinct labels and values\n  {\n    :value =\u003e \"$TOPIC\", :options =\u003e {\n      \"Abortion\" =\u003e \"943AD4D7-5056-A066-60A5-D652A671D70E\",\n      \"Agriculture\" =\u003e \"943AD58A-5056-A066-60BD-A9DBEE1187A1\",\n      \"Animal Welfare\" =\u003e \"943AD622-5056-A066-6065-1B45E2F6F45D\",\n    }\n  },\n ...\n]\n...\n```\n\nPass the required values, in a hash, to `CongressForms::Form#fill` to send the message.\n\n```ruby\nform = CongressForms::Form.find(\"H001075\")\n\nform.fill(\n  \"$NAME_FIRST\" =\u003e \"...\",\n  \"$NAME_LAST\" =\u003e \"...\",\n  \"$MESSAGE\" =\u003e \"...\",\n  ...\n)\n```\n\nFor Senate offices, this will fill out the representative's contact form with a headless instance of Google Chrome. For House offices, messages are submitted through the Communicating with Congress (CWC) API.\n\n\n### CLI Usage\n\nYou can also send messages from the command line:\n\n```\n$ bin/congress_forms --help\nUsage: congress_forms [options]\n    -i, --rep_id REP_ID              ID of the representative to message\n    -r, --repo DIR                   Location for unitedstates/contact_congress repository\n    -p, --param KEY=VALUE            e.g. -p NAME_FIRST=Badger\n```\n\n\n## Operation and Configuration\n\nSenate messages rely on contact form details tracked by the [unitedstates/contact-congress](https://github.com/unitedstates/contact-congress) project. This repo is cloned into a temporary directory by default. You can configure CongressForms to use an existing/persistent direcory with\n\n```ruby\nCongressForms.contact_congress_repository = \"data/contact_congress\"\n```\n\nA `git pull` is performed every now and then in this direcory, to keep the form details up to date. You can disable this behavior with\n\n```ruby\nCongressForms.auto_update_contact_congress = false\n```\n\nHouse messages are submitted through the [Communicating with Congress](https://www.house.gov/doing-business-with-the-house/communicating-with-congress-cwc) API. To send messages to the House, you will need to complete the vendor application process, then configure the API client with\n\n```ruby\nCwc::Client.configure(\n  api_key: ENV[\"CWC_API_KEY\"],\n  host: ENV[\"CWC_HOST\"],\n  delivery_agent: ENV[\"CWC_DELIVERY_AGENT\"],\n  delivery_agent_ack_email: ENV[\"CWC_DELIVERY_AGENT_ACK_EMAIL\"],\n  delivery_agent_contact_name: ENV[\"CWC_DELIVERY_AGENT_CONTACT_NAME\"],\n  delivery_agent_contact_email: ENV[\"CWC_DELIVERY_AGENT_CONTACT_EMAIL\"],\n  delivery_agent_contact_phone: ENV[\"CWC_DELIVERY_AGENT_CONTACT_PHONE\"]\n)\n```\n\n### CWC Concerns\n\nThe CWC API requires that you connect from a whitelisted IP address. This is true even for the test endpoint, which makes development and testing of the API client tricky.\n\nIf you have a whitelisted IP, you can use SSH port forwarding to tunnel requests to CWC through the approved server. Keep this command running in a console:\n\n```\n$ ssh -L [port]:test-cwc.house.gov:443 [server]\n```\n\nUse `https://localhost:[port]/` as your CWC host, and define these environment variables:\n\n```\nCWC_VERIFY_SSL=false\nCWC_HOST_HEADER=test-cwc.house.gov\n```\n\n(substitute `[server]` and `[port]` with your own values)\n\n### Disabling headless mode\n\nChrome can be run in windowed mode by setting the environment variable `HEADLESS=0`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/efforg/congress_forms.\n\n\n## License\n\nThe gem is available as open source under the terms of the [GPLv3 License](https://github.com/EFForg/congress_forms/blob/master/LICENSE.txt).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefforg%2Fcongress_forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefforg%2Fcongress_forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefforg%2Fcongress_forms/lists"}