CONFIRMATION #H4YWHZ
- MSP -> FCA (Kalispell)
- Delta 2393
- 9:58p MSP -> 11:46p FCA
""" | |
this tests a local instance of hmda explorer running at localhost:8000" | |
""" | |
import re | |
import datetime | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
driver = webdriver.Chrome() |
def dump_arrests(qset): | |
header = [ | |
'name', | |
'dob', | |
'address', | |
'transient', | |
'sex', | |
'race', | |
'agency', | |
'booking_county', |
from bs4 import BeautifulSoup as bs | |
from csvkit import CSVKitWriter as ckw | |
with open('enrollment.html', 'r') as f: | |
soup = bs(f.read()) | |
rows = soup.find('table').findAll('tr') | |
header = [td.text for td in rows[0].findAll('td')] | |
with open('enrollment.csv', 'w') as f: | |
writer = ckw(f) |
# scraper for joni james | |
# author: bill higgins, 8/27/2013 | |
import csvkit | |
import requests | |
from bs4 import BeautifulSoup as bs | |
import datetime | |
starter = datetime.datetime.now() |
from arrestee.models import Arrestee | |
from geopy.distance import distance as geo_distance | |
from geopy import Point | |
hildrugs = Arrestee.objects.filter( | |
booking_county__name='Hillsborough', | |
arrest_date__gte=datetime.datetime(2014, 2, 1), | |
arrest_date__lt=datetime.datetime(2014, 4, 1), | |
charge__code__category='Narcotics').distinct()#1,210 arrests | |
hits=[]# we'll use this list to collect arrests |
""" | |
python data structures: | |
https://docs.python.org/2/tutorial/datastructures.html | |
reference pages | |
https://docs.djangoproject.com/en/1.5/ | |
query filters | |
https://docs.djangoproject.com/en/1.5/ref/models/querysets/#methods-that-return-new-querysets |
import csv | |
import json | |
import requests | |
url = 'https://www.googleapis.com/fusiontables/v1/query?key=AIzaSyAYkamn8YeEjHRpv892i26Mfv6i09eEdPM&sql=SELECT%20beach_id,%20name,%20county,%20mid_lat,%20mid_lon,%20samples,%20pct_samples_bav,%20loc_valid%20FROM%201uK8UlIIOG59txfGjH2WxrDIr_KIxR9lGixkqTple%20WHERE%20state%20=%20%27FL%27&typed=true&callback=jQuery17105043562010396272_1404232573870&_=1404232574998' | |
jtext = requests.get(url).text.split('jQuery17105043562010396272_1404232573870(')[1].strip(');') | |
beaches_dict = json.loads(jtext) | |
with open('beach_data.csv', 'w') as f: | |
writer = csv.writer(f) |
# scraper for joni james | |
# author: bill higgins, 8/27/2013 | |
import csvkit | |
import requests | |
from bs4 import BeautifulSoup as bs | |
import datetime | |
starter = datetime.datetime.now() |
<style> #elex {color: #fff; width:578px; height:125px; background-image:url('http://tampabay.com/tbprojects/elections/2012/results/img/bunting578.jpg'); background-repeat:no-repeat; margin:0; padding:0;} .elex_logo {text-indent:-2000px;background-image: url('http://tampabay.com/tbprojects/elections/2012/results/img/election-title.png'); background-repeat:no-repeat; height:60px; width:390px; margin-left:auto;margin-right:auto;position:relative;top:20px;margin-bottom:20px;} #elex_brick_ul {color: #fff; list-style:none; margin:10px 20px; padding:0; overflow:hidden; font-family:helvetica,sans; font-weight:bold; width:578px; } .elex_brick_li {color: #fff; float:left; padding:2px; margin-top:1px; list-style-type:none; display:block; text-transform:uppercase; font-weight:bold;} .elex_brick_li a:hover { text-decoration:underline; background-color:#173f8a; font-weight:bold; } .elex_brick {display: block; color: #fff; padding-top: 3px; padding-right: 8px; padding-bottom: 3px; padding-left: 8px; width: auto; text-dec |