Commits

Matteo Bertini  committed edf2875

Remove hardcoded username and pwd

  • Participants
  • Parent commits fe617ae

Comments (0)

Files changed (1)

File scripts/pems_download.py

 VERBOSITY = (logging.WARN, logging.INFO, logging.DEBUG)
 DEFAULT_VERBOSITY = 0
 
-base_url = random.choice(['http://pems.eecs.berkeley.edu/', 'http://pems.dot.ca.gov/'])
 base_url = 'http://pems.dot.ca.gov/'
 report_args = "?report_form=1&dnode=VDS&content=loops&export=text&"
 selection_args = "station_id=%(station)s&s_time_id=%(s_time_id)d&e_time_id=%(e_time_id)d&"
     cj = cookielib.LWPCookieJar()
     opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
     urllib2.install_opener(opener)
-    if 'berkeley' in base_url:
-        auth = urllib.urlencode({"username": "naufraghi", "password": "horsew3"})
-        request = urllib2.Request(base_url.replace("http", "https"), auth)
-    else:
-        auth = urllib.urlencode({"username": "naufraghi", "password": "blue5h"})
-        request = urllib2.Request(base_url, auth)
+    auth = urllib.urlencode({"username": "<username>", "password": "<password>"})
+    request = urllib2.Request(base_url, auth)
     try:
         return urllib2.urlopen(request).code
     except: