Skip to content

Instantly share code, notes, and snippets.

View lathropd's full-sized avatar

Daniel Lathrop lathropd

View GitHub Profile
@lathropd
lathropd / test.csv
Created October 2, 2019 15:36
test csv data with annual top baseball player salary over time
year salary showAnnotation player city league
1874 2800 Fergus Malone Chi NA
1875 2200 Rich Higham Chi NL
1876 4000 Al Spalding Chi NL
1877 2900 Al Spalding Chi NL
1878 3700 Bob Ferguson Chi NL
1879 1800 Frank Flint Chi NL
1880 1800 Adrian Anson Chi NL
1881 2000 Jim O'Rourke Buf NL
1882 2400 Monte Ward Prov NL
Name Team POS Salary Total Value Years Conference # of years Average Pay
Mark Reynolds COL 1B 1000000 1000000 1 (2019) NL West 1 1000000
Ildemaro Vargas ARI SS 555000 555000 1 (2019) NL West 1 555000
Richie Martin BAL SS 555000 555000 1 (2019) AL East 1 555000
Drew Jackson BAL SS 555000 555000 1 (2019) AL East 1 555000
Eric Stamets CLE SS 555000 555000 1 (2019) AL Central 1 555000
Michael Kopech CWS SP 555000 555000 1 (2019) AL Central 1 555000
Caleb Frare CWS RP 555000 555000 1 (2019) AL Central 1 555000
Ryan Cordell CWS OF 555000 555000 1 (2019) AL Central 1 555000
Reed Garrett DET RP 555000 555000 1 (2019) AL Central 1 555000
@lathropd
lathropd / maryland.js
Created April 16, 2019 16:44
x-ray scraper for maryland mens basketball
let Xray = require('x-ray')
let x = Xray()
x('https://umterps.com/schedule.aspx?schedule=365', '.hide-on-medium-only .sidearm-schedule-game-links-boxscore', [{
url: 'a@href',
game: x('a@href', {
date: '.game-details dl dd',
time: '.game-details dl dd:nth-of-type(2)',
attendance: '.game-details dl dd:nth-of-type(3)',
@lathropd
lathropd / disney.csv
Created May 8, 2018 15:27
for victoria anderson's project
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 5. in line 7.
omeka_documented,featuring_film,source_film,format_type,nod_type,interaction,chapter_timecode_of_interaction,omeka_item_title
y,Tangled,The Little Mermaid,Original Object,Particular Princess Nod,Null post seashell,9(13) 1:18:25,"""Ariel's Seashell - Null Posting Engraving"""
y,Tangled,Beauty and the Beast,Film Salute,Past Movie Nod,Library Book,8(13) Chapter 1:03:55,"""Beauty and the Beast - Library Book"""
y,Tangled,Sleeping Beauty,Film Salute,Past Movie Nod,Library Book,8(13) Chapter 1:03:55,"""Sleeping Beauty - Library Book"""
y,Tangled,The Little Mermaid,Film Salute,Past Movie Nod,Library Book,8(13) Chapter 1:03:55,"""The Little Mermaid - Library Book"""
y,Tangled,Cinderella,Original Object,Particular Princess Nod,(Null Post) Glass Slipper,Chapter 1(13) 0:06:24,"""Cinderella's Glass Slipper - Null Post Engraving"""
y,Tangled,Sleeping Beauty,Original Object,Particular Princess Nod,(Null Post) Rose,Chapter 1(13) 0:6:24,"""Sleeping Beauty's Rose - Null Post Engraving"""
,Tangled,Snow White,Original Object,Pa
var mainUrl = 'https://www.dhs.gov/immigration-statistics/yearbook/2016/table2'; var userAgent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36';
rp({url: mainUrl, headers:{'User-Agent': userAgent } }
let request = require('request')
let rp = require('request-promise-native');
let cheerio = require('cheerio');
let d3 = require('d3');
let fs = require('fs');
let sleep = require('thread-sleep');
var mainUrl = "http://www.journalismjobs.com/job-listings";
var data = [];
let request = require('request')
let rp = require('request-promise-native');
let cheerio = require('cheerio');
let d3 = require('d3');
let fs = require('fs');
let sleep = require('thread-sleep');
var mainUrl = "http://www.journalismjobs.com/job-listings";
var data = [];
let request = require('request')
let rp = require('request-promise-native');
let cheerio = require('cheerio');
let d3 = require('d3');
let fs = require('fs');
var mainUrl = "http://www.spotrac.com/mlb/payroll";
var teamList = [];
var playerSalaries = [];
@lathropd
lathropd / index.js
Created April 2, 2018 23:32
multipage_scraper created by lathropd - https://repl.it/@lathropd/multipagescraper
let request = require('request')
let rp = require('request-promise-native');
let cheerio = require('cheerio');
let d3 = require('d3');
let fs = require('fs');
var mainUrl = "http://www.spotrac.com/mlb/payroll";
var teamList = [];
var playerSalaries = [];
@lathropd
lathropd / index.js
Last active April 4, 2018 17:57
multipage_scraper created by lathropd - https://repl.it/@lathropd/multipagescraper
let request = require('request')
let rp = require('request-promise-native');
let cheerio = require('cheerio');
let d3 = require('d3');
var mainUrl = "http://www.spotrac.com/mlb/payroll";
var playerSalaries = [];