This file contains 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 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 |
This file contains 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 time | |
import json | |
import requests | |
session = requests.Session() | |
page_num = 1 | |
# Extracted from the Network tab of my Web inspector in Firefox | |
params = { |
This file contains 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
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', |
This file contains 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
#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. |