Skip to content

Instantly share code, notes, and snippets.

View mikejcorey's full-sized avatar

Michael Corey mikejcorey

View GitHub Profile
@mikejcorey
mikejcorey / testscrape.py
Created April 6, 2017 17:17
A non-working ejendomstorvet scrape
import time
import json
import requests
session = requests.Session()
session.headers['User-Agent'] = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'
page_num = 1
# Extracted from the Network tab of my Web inspector in Firefox
import time
import json
import requests
session = requests.Session()
page_num = 1
# Extracted from the Network tab of my Web inspector in Firefox
params = {
@mikejcorey
mikejcorey / gist:c26c7b875e5c370f0e14
Created August 15, 2014 22:45
Matchmaker, matchmaker, find me valid pairs.
filing_id_amendment_pairs = Filing.objects.all().values('filing_id_raw', 'amend_id', 'filer__pk')
for fa in filing_id_amendment_pairs:
try:
match = CvrLobbyDisclosureCd.objects.get(
filing_id=fa['filing_id_raw'],
amend_id=fa['amend_id']
).values(
'filing_id',
'filer_naml',
@mikejcorey
mikejcorey / Getting memcached working for Django on OSX
Created September 4, 2013 20:16
Process for installying MemCached for use in Django apps on OS X
#Global stuff
#First, install memcached and libmemcached using homebrew. This may require gcc, which may require you to update your XCode if it's not up to date.
brew install memcached
brew install libmemcached
#Python stuff, inside your virtual environment
pip install pylibmc, etc.