All Projects → jeffreyshen19 → BillScraper.js

jeffreyshen19 / BillScraper.js

Licence: CC0-1.0 license
A Javascript module to scrape, analyze, and cache Congressional bills

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to BillScraper.js

radar
Estamos de mudança para o GitLab: https://gitlab.com/radar-parlamentar/radar.
Stars: ✭ 84 (+170.97%)
Mutual labels:  politics, congress
calltoaction
Call Congress with a tap
Stars: ✭ 16 (-48.39%)
Mutual labels:  politics, congress
contact-officials
Form definitions powering Resistbot's electronic deliveries to elected officials in the United States.
Stars: ✭ 29 (-6.45%)
Mutual labels:  politics, congress
Holyfucktheelectionistomorrow
holy fuck
Stars: ✭ 92 (+196.77%)
Mutual labels:  politics
My Little Crony
A visualization of the connections between Tory politicians and companies being awarded government contracts during the pandemic.
Stars: ✭ 118 (+280.65%)
Mutual labels:  politics
Leftvalues.github.io
LeftValues, a leftist political quiz
Stars: ✭ 224 (+622.58%)
Mutual labels:  politics
yournextrepresentative
A website for crowd-sourcing structured election candidate data
Stars: ✭ 56 (+80.65%)
Mutual labels:  politics
Amfv
A Mind Forever Voyaging, by Steve Meretzky (Infocom)
Stars: ✭ 81 (+161.29%)
Mutual labels:  politics
nyt-first-said
Tweets when words are published for the first time in the NYT
Stars: ✭ 222 (+616.13%)
Mutual labels:  politics
Everypolitician Data
data for national legislatures worldwide
Stars: ✭ 174 (+461.29%)
Mutual labels:  politics
Theyworkforyou
Keeping tabs on the UK's parliaments and assemblies
Stars: ✭ 173 (+458.06%)
Mutual labels:  politics
Call My Congress
DEPRECATED. Simple app that displays contact information for US Congress representatives by district.
Stars: ✭ 125 (+303.23%)
Mutual labels:  politics
awesome-democracy-data
A curated list of awesome data sources related to elections, electoral reforms, and democratic political systems.
Stars: ✭ 59 (+90.32%)
Mutual labels:  politics
Pokr.kr
Pokr [ˈpō-kər] - Politics in Korea (Out of service since Dec 2018)
Stars: ✭ 111 (+258.06%)
Mutual labels:  politics
impeachment-timeline
Timeline of events that lead to the impeachment of Donald J. Trump →
Stars: ✭ 14 (-54.84%)
Mutual labels:  politics
Lietuvos Respublikos Konstitucija
Lietuvos Respublikos Konstitucija ir ją pagrindžiantys dokumentai. Su visa keitimų istorija.
Stars: ✭ 87 (+180.65%)
Mutual labels:  politics
github-dramas
🎦 Collection of dramas on GitHub
Stars: ✭ 65 (+109.68%)
Mutual labels:  politics
Dados Abertos
Repositório do serviço de Dados Abertos da Câmara. Consulte as "Issues" para atendimento a dúvidas e sugestões.
Stars: ✭ 153 (+393.55%)
Mutual labels:  politics
Votemapswitzerland
A Swiss version of the famous visualization «Land doesn't vote, people do.»
Stars: ✭ 150 (+383.87%)
Mutual labels:  politics
Philosophy
A list of philosophy books and resources.
Stars: ✭ 206 (+564.52%)
Mutual labels:  politics

BillScraper.js 📝📝📝

Build Status codecov npm version Inline docs License: CC0-1.0

A NPM module to scrape, analyze, and cache Congressional bills. Works for bills from the 113th, 114th, and 115th congress.

Table of Contents

  • docs: Holds markdown files that explain the project in more detail.
  • examples: Holds example code.
  • example_outputs: Holds example outputs.
  • lib: Holds all Javascript files
  • misc: Hold all graphics for the README.md
  • test: Holds all unit tests.

Getting Started

  • To get started, visit GET_STARTED.md.
  • For examples of how to use the library, visit examples.
  • A variety of guides on how to use the library are available in docs.
  • Documentation for all the methods is available here.

Why?

The government hosts bulk data for all congressional bills at gpo.gov/fdsys/bulkdata. However, this repository is horrible to use for developers, as bills are uploaded to unpredictable URLS as XML files. Each bill file is too structured, as XML style elements like paragraphs, bold text, and quotes are preserved, making it hard to parse the actual text of a bill.

What does this project do

  • Returns full Congressional bill text and metadata from Congress.gov as JSON. This library can scrape both the actual bill text (bills) and meta information such as cosponsors, amendments, and committees (bill statuses). For example, the following code will convert the XML (on the top) into the JSON (on the bottom)
var billScraper = require("bill-scraper");

billScraper.getBill("BILLS-113hr1033rs", function(res){
  billScraper.printBill(res, function(parsedResult){
    console.log(JSON.stringify(parsedResult));
  });
}, {session: 2});
XML JSON
XML JSON

For more detailed examples, visit examples/get_bills.js.

  • Parses bills for key points and ideas: This project generates "tags" for bills, allowing them to more easily searched. For instance, searching for all bills tagged with "battlefield".
var billScraper = require("bill-scraper");

billScraper.getBill("BILLS-113hr1033rs", function(res){
 billScraper.printBill(res, function(parsedResult){
   billScraper.tagBill(parsedResult, function(tags){
      console.log(tags);
   });
 });
}, {session: 2});

//Will return ['battlefield', 'sites','war','section','land','subsection','period','funds','appropriation','protection','revolutionary','public','sub','term','nations','civil','preservation','service','sellers','prohibition','purposes','person','entity','matter','influence','law','ratification','policy'];

For more detailed examples, visit examples/tag_bills.js.

  • Generates a searchable Mongo database of bills: For example, the following code will locally cache a database (see photo below) of parsed, searchable bills.
var billScraper = require("bill-scraper");
var mongoose = require("mongoose");

mongoose.connect("mongodb://localhost/bills");
billScraper.generateDB("hr", 115, 1);

Database

For documentation on the Bill struct stored in the database, visit BILL_TEMPLATE.md in docs, for more detailed examples, visit examples/database.js, and for information on searching bills, see the examples in examples/search_bills.js.

Community

This repository encourages all users to contribute. Please read the Code of Conduct and Contributing.md. For things to contribute, check out the issues or TODO.md.

Datasets used

Relevant libraries used

View the package.json for the full list of dependencies.

Contributors

View the full list of contributors here.

License

This repository is licensed as CC0. See the LICENSE for more information.


CC0
To the extent possible under law, Jeffrey Shen has waived all copyright and related or neighboring rights to BillScraper.js. This work is published from: United States.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].