Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrettmac/c191dec533cb27b3edd242cbfe7f4e27 to your computer and use it in GitHub Desktop.
Save garrettmac/c191dec533cb27b3edd242cbfe7f4e27 to your computer and use it in GitHub Desktop.
politicc text

There are four types of legislation that move through Congress:

Bills and three types of resolutions.

Generally, bills are legislative proposals that, if enacted, carry the force of law, whereas resolutions do not. Though, this is not always true.

Bills Vs Resolutions.

Bills

Bills, are legislative proposals that, if enacted, carry the force of law.

Resolutions

By and large, resolutions are not used to enact law. There are three types of resolutions:

Simple Resolutions

Simple resolutions are usually used for each chamber to set their own rules, like how much time is used for debate. They are voted on only in their originating chamber only and don’t have the force of law.

Concurrent Resolutions

Concurrent resolutions are similar, but are used for rules that affect both chambers of Congress, such as when Congress will adjourn at the end of their two-year sessions, or to express the sentiments of both chambers. Concurrent resolutions are voted on by both chambers, but are not signed by the President and do not carry the force of law.

Joint Resolutions

Joint resolutions are more interesting. They have two uses, and why they have these uses is a matter of history. First, joint resolutions can be used to enact law in exactly the same manner as a bill. This is rare. Even more rare is their second use. Joint resolutions are how Congress begins the process of a constitutional amendment. These types of joint resolutions must be passed by both chambers and then ratified by 3/4ths of the states, but, as the Constitution says, they need not be approved by the President, in order to amend the Constitution.

How to Read A Bill

  • H.R.# - Bill that started in House

  • S.# - Bill that started in Senate

  • H.Res.# - House Simple Resolutions

  • S.Res.# - Senate Simple Resolutions

  • H.J.Res.# - House Joint Resolutions

  • S.J.Res.# - Senate Joint Resolutions

  • H.Con.Res.# - House Concurrent Resolutions

  • S.Con.Res.# - Senate Concurrent Resolutions

Legislation Numbering

Where "#" indicates the unique number of the legislation. This is determined by the order the legislation was introduced on the chamber floor. In order for legislation to be properly introduced it must included the author's name and a descriptive title for the legislation and is usually read on the chamber floor.

Each legislation numbering is determined dependent of it's chamber, so there is both a H.R. 1 (for House of Representatives) and S. 1. (for Senate).

The difference between “H.R.” and “S.” is entirely procedural. It has no bearing on law.

Extra

Special House Powers The Constitution requires that appropriations bills, that is, those that direct spending, originate in the House. So all appropriations bills are “H.R.” bills, however, when the Senate wants to originate an appropriations bill, sometimes they do some creative procedural actions to take a failed House bill and replace its text with the appropriations they want. Thus technically the bill originated in the House, even though the text of the bill really came from the Senate. They did this with the stimulus bill a year ago.

@garrettmac
Copy link
Author

Docs

Politicc Api Methods

Firebase

updateFirebaseSnapshot(updatePath,failUpdatePath,data,unionById,overrideExisting,debugMode) - update firebase snapshot

Requirements

Parameter Type Description
updatePath string firebase path to update
failUpdatePath string firebase path to update if fails (saves data)
data object /array new data to save or update
unionById if array unionBy Id https://lodash.com/docs/4.17.4#unionBy
overrideExisting boolean default false. merge but make new the master version
debugMode boolean default false only log. dont save

Example Usage

updateFirebaseSnapshot(`congress/115/bills/12345`,`congress/115/bills/bills_without_id`,data,unionById,false,debugMode)
const _updatedSnap = (oldData,newData,unionById,overrideExisting) => {
    if(_.isArray(oldData)&&_.isArray(newData)){
        let newSnap=[]
        if(unionById){
            if(overrideExisting===true)newSnap=_.unionBy(newData,oldData,unionById)
            if(overrideExisting===false)newSnap=_.unionBy(oldData,newData,unionById)
        }else{
            if(overrideExisting===true)newSnap=_.union(newData,oldData)
            if(overrideExisting===false)newSnap=_.union(oldData,newData)
        }
        return newSnap
   }else if(_.isObject(oldData)&&_.isObject(newData)){
        if(overrideExisting===true) return _.defaultsDeep(newData,oldData)
        else return _.defaultsDeep(oldData,newData)        
    }else{
        return oldData
    }
}

export function updateFirebaseSnapshot(updatePath,failUpdatePath,data,unionById,overrideExisting=false,debugMode=false){
  // data.lastUpdated= firebase.database.ServerValue.TIMESTAMP;

if(!updatePath){
  let update ={}
  let uniqueKey=Firebase.database().ref(`/somepath`).push().key
  update[`${failUpdatePath}/${uniqueKey}`]=data
 
  if(debugMode===false) Firebase.database().ref().update(update)
else console.log(`DEBUG MODE (not saved) -failed:`,update))
  return
}
let ref = Firebase.database().ref(`${updatePath}`).once('value',snap=> {
    let updatedSnap=_updatedSnap(snap.val(),data,unionById,overrideExisting)
    let FIREBASE_SAVE_METHOD=(_.isArray(updatedSnap))?"set":"update";
    if(debugMode===false)ref[FIREBASE_SAVE_METHOD](updatedSnap)
else console.log(`DEBUG MODE (not saved): ${updatePath}:`,updatedSnap)
})

updateFirebaseSnapshot(`congress/115/bills/12345`,`congress/115/bills/bills_without_id`,data,unionById,false,debugMode)
}

Congressmen

fetchCongressMenCSpanVideos - Get Latest CSpan Videos for Congressmen

Try using Runkit https://runkit.com/vygaio/599ddad8d429270012aa0976

See Cspan licensing rules
https://www.c-span.org/about/copyrightsAndLicensing/

Requirements

Parameter Type Description
cspan_id string congressmens cspan_id attr
import cheerio from "cheerio";
import axios from "axios";
import _ from "lodash";

export function fetchCongressMenCSpanVideos(cspan_id) {
    return new Promise((resolve, reject) => {
        //get our html
        //var url="https://www.c-span.org/person/?berniesanders"
        axios.get(`http://www.c-spanvideo.org/person/${cspan_id}`)
            .then(resp => {
                //html
                const html = resp.data;
                //load into a $
                const $ = cheerio.load(html);
                //find ourself a img
                const videos = $("#recent-appearances").find("li").map(function(i, elem) {
                    // fruits[i] = $(this).text();
                    return {
                        url: $(this).find("a").attr('href'),
                        thumb: $(this).find("img").attr('src'),
                        date: $(this).find("time").text(),
                        title: $(this).find("h3").text(),
                        description: $(this).find("p").text()
                    }
                });

                resolve(videos);

            })
            .catch(err => {
                reject(err);
            });
    });
}

let cspan_id = "994" //bernie sanders

fetchCongressMenCSpanVideos().then(x => console.log(x))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment