Skip to content

Instantly share code, notes, and snippets.

CTYNAME Pop GrowthRate
Los Angeles County 10105518 2.8820
San Diego County 3343364 7.7356
Orange County 3185968 5.6160
Riverside County 2450758 11.3145
San Bernardino County 2171603 6.4037
Santa Clara County 1937570 8.4818
Alameda County 1666753 10.1590
Sacramento County 1540975 8.4114
Contra Costa County 1150215 9.2780
import requests
def fetchPredictions():
apikey = ""
filter_route = "Green-B,Green-C,Green-D,Green-E"
include = "vehicle,trip"
p = {"filter[route]": filter_route, "include": include}
result = requests.get("https://api-v3.mbta.com/predictions", params=p).json()

Keybase proof

I hereby claim:

  • I am nhfruchter on github.
  • I am fruchter (https://keybase.io/fruchter) on keybase.
  • I have a public key ASAhBboC7sMUtG6w6naLBRbRHIUu6YFLuR5lsKWdwdqQnQo

To claim this, I am signing this object:

@nhfruchter
nhfruchter / String.ipynb
Created June 13, 2018 19:04
Dumb stuff with operator overloading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nhfruchter
nhfruchter / fcc-cites.py
Created November 30, 2017 18:43
Rough comment citation extraction from FCC text
import string
import re
import requests
from collections import Counter
fcc = requests.get("https://apps.fcc.gov/edocs_public/attachmatch/DOC-347927A1.txt").content.decode('windows-1252')
fcc.replace("”", "")
fcc.replace("“", "")
fcc.replace("et al", "")
@nhfruchter
nhfruchter / 17-108 RM Top Citations - By Source.csv
Created November 30, 2017 05:26
Which comments does the FCC cite most often in its net neutrality rulemaking?
Group Cites Category Notes
ACLP 9 Academic
PATRICK LEERSSEN 6 Academic
IEP 5 Academic George Mason
CHRISTOPHER YOO 5 Academic
BEN KREUTER 2 Academic
ECONOMIDES 4 Academic
M-LAB 1 Academic
MERGEN 1 Academic
FTC STAFF 18 Government
@nhfruchter
nhfruchter / fcc.sh
Created May 11, 2017 05:02
Spam the FCC :(
curl \
-H "Content-Type: application/json" \
-X POST \
--data-binary '{
"documents":[],
"proceedings":[{
"name":"17-108",
"description":"Restoring Internet Freedom",
"id_proceeding":301759
}],
Roll Call
September 6, 1997
Soft Money Is Good: 'Hard-Earned American Dollars That Big Brother Has Yet to Find a Way to Control'
BYLINE: By Betsy DeVos
LENGTH: 1380 words
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 11 columns, instead of 2. in line 7.
date,tweet,action,reason,update,hangover,locationRange1,locationRange2,station,time of day,Severity
2016/12/09 10:10:00 AM,Update: Regular service has resumed,RESUME,,1,0,,,,10.166666667,
2016/12/09 8:31:00 AM,Minor northbound delays from Downtown Crossing to Alewife due to a disabled train,DELAY,disabled train,0,0,Downtown Crossing,Alewife,,8.5166666667,Minor
2016/12/08 11:30:00 PM,Red Line experiencing delays due to medical emergency at Harvard northbound,DELAY,medical emergency,0,0,,,Harvard,23.5,
2016/12/08 2:45:55 PM,Update: Regular service is resuming,RESUME,,1,0,Park Street,Alewife,,14.765277778,
2016/12/08 2:25:03 PM,Update: Minor northbound delays from Park Street to Alewife due to a signal problem at Harvard:,DELAY,signal problem,1,0,Park Street,Alewife,Harvard,14.4175,Minor
2016/12/08 12:55:16 PM,Update: Moderate northbound delays from Park Street to Alewife due to a signal problem at Harvard:,DELAY,signal problem,1,0,Park Street,Alewife,Harvard,12.921111111,Moderate
2016/12/08 12:29:45 PM,Minor n
Body Screen Face
0 867.0 867.0 867.0
1 267.0 100.0 167.0
2 167.0 67.0 900.0
3 900.0 566.0 433.0
4 433.0 1000.0 633.0
5 633.0 566.0 600.0
6 600.0 367.0 534.0
7 534.0 700.0 567.0
8 567.0 400.0 933.0