Methods
cleanBill(bill, callback) → {object}
Asynchronously parses the output from getBill.js into a more manageable object.
Parameters:
Name | Type | Description |
---|---|---|
bill |
object | JSON bill (result from getBill.js) |
callback |
function | Callback |
- Source:
Returns:
- JSON result
- Type
- object
Example
getBill("BILLS-115hr1001ih", function(res){
cleanBill(res, function(parsedResult){
//parsedResult is JSON
});
});
cleanBillStatus(bill, callback) → {object}
Asynchronously parses the output from getBillStatus.js into a more manageable object.
Parameters:
Name | Type | Description |
---|---|---|
bill |
object | JSON bill (result from getBillStatus.js) |
callback |
function | Callback |
- Source:
Returns:
- JSON result
- Type
- object
Example
getBillStatus("BILLSTATUS-115hr99", function(res){
cleanBillStatus(res, function(parsedResult){
//parsedResult is JSON
});
});
createBill(bill, options, session) → {object}
Adds a Bill schema to the bill database
Parameters:
Name | Type | Description |
---|---|---|
bill |
string | Name of the bill (i.e. BILLS-113hr1033rs) |
options |
object | Options (Optional) |
session |
number | Session Number (Default: 1) |
- Source:
Returns:
- JSON result
- Type
- object
Example
createBill("BILLS-113hr1033rs", {session: 2});
generateDB()
Automatically generates the entire database of bills
- Source:
Example
generateDB()
getBill(billName, callback, options) → {object}
Asynchronously returns the data for the given bill as JSON
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
billName |
string | The name of bill (i.e. "BILLS-115hr1001ih") | |||||||||
callback |
function | Callback | |||||||||
options |
object | Options (Optional)
Properties
|
- Source:
Returns:
- JSON result
- Type
- object
Example
getBill("BILLS-115hr1001ih", function(res){
//res is a JSON object
});
getBillStatus(billName, callback, options) → {object}
Asynchronously returns the data for the given bill status as JSON
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
billName |
string | The name of bill (i.e. "BILLSTATUS-115hr99") | ||||||
callback |
function | Callback | ||||||
options |
object | Options (Optional)
Properties
|
- Source:
Returns:
- JSON result
- Type
- object
Example
getBillStatus("BILLSTATUS-115hr99", function(res){
//res is a JSON object
});
getBulk(billType, callback, options)
Asynchronously accesses list of bills in a given session as an array
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
billType |
string | The type of bill (hr, s) | |||||||||
callback |
function | Callback (with one paramater) | |||||||||
options |
object | Options (Optional)
Properties
|
- Source:
Example
getBulk("hr", function(res){
//res is an array
}, {
congress: 115,
session: 1
});
getBulkStatus(billType, callback, options)
Asynchronously accesses list of bill statuses as an array
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
billType |
string | The type of bill (hr, s) | ||||||
callback |
function | Callback (with one paramater) | ||||||
options |
object | Options (Optional)
Properties
|
- Source:
Example
getBulkStatus("hr", function(res){
//res is an array
});
recursivelyGenerateBody(bill, callback) → {object}
Asynchronously combines all the text fields from cleanBill.js into a more manageable JSON object
Parameters:
Name | Type | Description |
---|---|---|
bill |
object | JSON bill (result from cleanBill.js) |
callback |
function | Callback |
- Source:
Returns:
- JSON result
- Type
- object
Example
getBill("BILLSTATUS-115hr99", function(res){
printBill(res, function(parsedResult){
});
});
tagBill(bill, callback, options) → {object}
Takes a printedBill (from printBill.js) and "tags" it: Returns an array of autogenerated tags and subjects.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
bill |
object | JSON bill (result from printBill.js) | ||||||
callback |
function | Callback | ||||||
options |
object | Options (Optional)
Properties
|
- Source:
Returns:
- An array of generated tags for the bill
- Type
- object
Example
getBill("BILLSTATUS-115hr99", function(res){
printBill(res, function(parsedResult){
tagBill(parsedResult, function(tags){
//tags is an array of tags
});
});
});