This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
from playwright.sync_api import sync_playwright | |
today = date.today().isoformat() | |
filename = f'il-sex-offenders-{today}.csv' | |
with sync_playwright() as p: | |
browser = p.chromium.launch(headless=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
API_KEY = os.environ.get('FEC_API') | |
DONOR_URL = 'https://api.open.fec.gov/v1/schedules/schedule_a' | |
# for brevity, will skip the read-in-the-csv step | |
# `names` is a list of first initial/last name strings | |
# e.g. `J DOE` | |
# list of records to write out | |
data_out = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CHAPTER I. Professor Persikov's Curriculum Vitae | |
On the evening of 16 April, 1928, the Zoology Professor of the Fourth State University and Director of the Moscow Zoological Institute, Persikov, went into his laboratory at the Zoological Institute in Herzen Street. The Professor switched on the frosted ceiling light and looked around him. | |
This ill-fated evening must be regarded as marking the beginning of the appalling catastrophe, just as Professor Vladimir Ipatievich Persikov must be seen as the prime cause of the said catastrophe. | |
He was fifty-eight years old. With a splendid bald head, like a pestle, and tufts of yellowish hair sticking out at the sides. His face was clean-shaven, with a slightly protruding lower lip which gave it a slightly cantankerous expression. Tall and round-shouldered, he had small bright eyes and tiny old-fashioned spectacles in silver frames on a red nose. He spoke in a grating, high, croaking voice and one of his many idiosyncrasies was to crook the index finger of his right |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first install curl and poppler-utils, if you don't have already | |
curl https://www.cbp.gov/sites/default/files/documents/Agriculture%20Canine%20Cards.pdf > dogs.pdf | |
pdfimages -png dogs.pdf goodboi |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocID,FilerName,MemberName,State,District,Year,Destination,FilingType,DepartureDate,ReturnDate,TravelSponsor,pdf_link | |
500003590,Mark Bayer,"Markey, Edward J.",MA,5.0,2010,"Las Vegas, NV",Original,2010-01-07,2010-01-09,Consumer Electronics Association,http://clerk.house.gov/GTImages/ST/2010/500003590.pdf | |
500003602,Joshua Finestone,"Rogers, Mike",AL,3.0,2010,"Las Vegas, NV",Original,2010-01-06,2010-01-08,Consumer Electronic Association,http://clerk.house.gov/GTImages/ST/2010/500003602.pdf | |
500003603,Jeff Choudhry,"Franks, Trent",AZ,8.0,2010,"Las Vegas, NV",Original,2010-01-07,2010-01-09,Consumer Electronics Association,http://clerk.house.gov/GTImages/ST/2010/500003603.pdf | |
500003616,Solomon Ortiz,"Ortiz, Solomon P.",TX,27.0,2010,"Beijing, China",Original,2010-01-02,2010-01-10,Robstown Improvement Development Board,http://clerk.house.gov/GTImages/ST/2010/500003616.pdf | |
500003616,Solomon Ortiz,"Ortiz, Solomon P.",TX,27.0,2010,"Quingdao, China",Original,2010-01-02,2010-01-10,Robstown Improvement Development Board,htt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################### | |
# quick bash script to geocode a place name and # | |
# load tab-separated coordinates to clipboard # | |
# (n.b. uses osx `pbcopy`, so swap in whatever # | |
# works for your os in the last line) # | |
# # | |
# you'll need jq and an opencage geocode API key, # | |
# which i stored in an environment variable called # | |
# $OPENCAGE_GEOCODE_API # | |
# # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import sample | |
from itertools import chain | |
FAMILIES = { | |
'Joel and Amanda Sletten': ['Blaine', 'Bruce', 'Titus', 'Olivia'], | |
'Micah and Leslie Winchester': ['Jack', 'Alex'], | |
'Cody and Laurel Winchester': ['Julian', 'Lucy'], | |
'Barry and April Winchester': ['Brook', 'Blake'] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import requests | |
from bs4 import BeautifulSoup | |
target_keywords = ['bookshelf', 'book shelf', 'desk'] | |
url = 'https://cosprings.craigslist.org/search/zip' | |
r = requests.get(url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dear {RECORDS CUSTODIAN}, | |
Pursuant to the Colorado Open Records Act § 24-72-201 et seq., I request {DESCRIBE THE RECORDS YOU SEEK IN SOME DETAIL HERE}. | |
If you are not the custodian of the records being requested, please redirect this to the appropriate person's attention and apprise me of the change. | |
In keeping with Colo. Rev. Stat. § 24-72-203(3.5)(a), which states that a governmental entity must provide digital records in a searchable or sortable format if the records exist in that format, I request that these data be provided in a machine-readable electronic format that can be imported into standard database software. Examples include an Excel .xls or .xlsx file, an Access .mdb or .accdb file, a text-based delimited file (.csv, .txt., .tsv., etc.), a .dbf file or an SQL dump. This would NOT include PDFs, which are not readable by database software. | |
I am a member of the news media requesting this information for newsgathering purposes. I request a waiver of fees for searching or copying these records be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import zip_longest | |
def spongebobify(text): | |
up = text[::2].upper() | |
low = text[1::2].lower() | |
return ''.join([''.join(x) for x in list(zip_longest(up,low,fillvalue=''))]) |
NewerOlder