From bf043d7e238a8bc234d5007d41f15dc3b472ca7a Mon Sep 17 00:00:00 2001 From: BMcKiernan Date: Tue, 17 Apr 2018 02:06:14 -0400 Subject: [PATCH 1/3] Bringing up sniper for Fall 2018 registration --- cron.py | 2 +- soc.py | 2 +- templates/home.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cron.py b/cron.py index cff7eba..0aac043 100644 --- a/cron.py +++ b/cron.py @@ -75,7 +75,7 @@ def notify(snipe, index): # build the url for prepopulated form url = 'http://sniper.rutgers.io/?%s' % (urllib.urlencode(attributes)) - register_url = 'https://sims.rutgers.edu/webreg/editSchedule.htm?login=cas&semesterSelection=12018&indexList=%s' % (index) + register_url = 'https://sims.rutgers.edu/webreg/editSchedule.htm?login=cas&semesterSelection=92018&indexList=%s' % (index) email_text = 'A course (%s) that you were watching looks open. Its index number is %s. Click the link below to register for it!\n\n %s \n\n If you don\'t get in, visit this URL: \n\n %s \n\n to continue watching it.\n\n Send any feedback to sniper@rutgers.io' % (course, index, register_url, url) diff --git a/soc.py b/soc.py index a00eb19..93bf1db 100644 --- a/soc.py +++ b/soc.py @@ -6,7 +6,7 @@ class Soc: """ Communicates with Rutgers SOC """ - def __init__(self, campus='NB', semester='12018', level='U,G'): + def __init__(self, campus='NB', semester='92018', level='U,G'): """ We always use certain parameters""" self.base_url = 'http://sis.rutgers.edu/soc' self.params = { diff --git a/templates/home.html b/templates/home.html index e8ff7a5..9e68db8 100644 --- a/templates/home.html +++ b/templates/home.html @@ -6,7 +6,7 @@ {% from "_formhelpers.html" import render_field %}
-

Enter your details below, and I'll notify you when your class opens up. Sniper is currently watching courses for Spring 2018 on the Rutgers New Brunswick campus.

+

Enter your details below, and I'll notify you when your class opens up. Sniper is currently watching courses for Fall 2018 on the Rutgers New Brunswick campus.

From 90dfac695ff89c85b4d5ac72c1c6d5d940c4714a Mon Sep 17 00:00:00 2001 From: BMcKiernan Date: Sat, 21 Apr 2018 22:28:58 -0400 Subject: [PATCH 2/3] updated spoof switch smtp server to gmail --- .gitignore | 2 ++ app.py | 5 ++--- cron.py | 2 +- soc.py | 5 ++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 5874785..c669f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ *.db secrets.py ENV +snipeenv +venv diff --git a/app.py b/app.py index 4fe737a..a3a616e 100644 --- a/app.py +++ b/app.py @@ -25,8 +25,7 @@ app.logger.addHandler(file_handler) app.wsgi_app = ProxyFix(app.wsgi_app) - -app.config['MAIL_SERVER'] = 'smtp.sendgrid.net' +app.config['MAIL_SERVER'] = 'smtp.gmail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME'] = mail_username @@ -103,7 +102,7 @@ def ajaxtest(): message = Message('Sniper tests are failing', sender=EMAIL_SENDER) message.body = 'FIX IT' - message.add_recipient('vaibhav2614@gmail.com') + message.add_recipient('brimck89@gmail.com') mail.send(message) return json.dumps(result) diff --git a/cron.py b/cron.py index 0aac043..82f1c23 100644 --- a/cron.py +++ b/cron.py @@ -11,7 +11,7 @@ soc = Soc() -EMAIL_SENDER = "Course Sniper " +EMAIL_SENDER = "Course Sniper " Section = namedtuple('Section', ['number', 'index']) diff --git a/soc.py b/soc.py index 93bf1db..ac8b81b 100644 --- a/soc.py +++ b/soc.py @@ -6,7 +6,7 @@ class Soc: """ Communicates with Rutgers SOC """ - def __init__(self, campus='NB', semester='92018', level='U,G'): + def __init__(self, campus='NB', semester='92018', level='U'): """ We always use certain parameters""" self.base_url = 'http://sis.rutgers.edu/soc' self.params = { @@ -17,10 +17,9 @@ def __init__(self, campus='NB', semester='92018', level='U,G'): # Spoof the user agent for good measure self.headers = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36', } - def query(self, resource, params): """Queries the given resource (a string) with the given parameters. For example self.query('/api/subjects.json', { 'keyword': 'Computer Science' })""" From f45ccabe2bd7995875d5bef583ca47df4678577c Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Sun, 22 Apr 2018 03:01:27 +0000 Subject: [PATCH 3/3] reset sendgrid --- app.py | 2 +- check.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ cron.py | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 check.txt diff --git a/app.py b/app.py index a3a616e..54b2d65 100644 --- a/app.py +++ b/app.py @@ -25,7 +25,7 @@ app.logger.addHandler(file_handler) app.wsgi_app = ProxyFix(app.wsgi_app) -app.config['MAIL_SERVER'] = 'smtp.gmail.com' +app.config['MAIL_SERVER'] = 'smtp.sendgrid.net' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME'] = mail_username diff --git a/check.txt b/check.txt new file mode 100644 index 0000000..d06ddba --- /dev/null +++ b/check.txt @@ -0,0 +1,61 @@ +alembic==0.3.5 +aws-cfn-bootstrap==1.4 +awscli==1.14.9 +Babel==0.9.4 +backports.ssl-match-hostname==3.4.0.2 +blinker==1.2 +boto==2.48.0 +botocore==1.8.13 +chardet==1.1 +cloud-init==0.7.6 +colorama==0.2.5 +configobj==4.7.2 +docutils==0.11 +ecdsa==0.11 +Flask==0.9 +Flask-Mail==0.6.1 +Flask-SQLAlchemy==0.16 +Flask-WTF==0.8 +flup==1.0.3.dev20110405 +futures==3.0.3 +gunicorn==0.15.0 +hibagent==1.0.0 +httplib2==0.7.4 +iniparse==0.3.1 +Jinja2==2.6 +jmespath==0.9.2 +jsonpatch==1.2 +jsonpointer==1.0 +kitchen==1.1.1 +lamson==1.1 +lockfile==0.9.1 +Mako==0.7.2 +MarkupSafe==0.15 +mock==1.0b1 +nose==1.1.2 +paramiko==1.15.1 +PIL==1.1.6 +ply==3.4 +pyasn1==0.1.7 +pycrypto==2.6.1 +pycurl==7.19.0 +pygpgme==0.3 +PyJWT==0.1.2 +pyliblzma==0.5.3 +pystache==0.5.3 +python-daemon==1.6 +python-dateutil==2.1 +pyxattr==0.5.0 +PyYAML==3.10 +requests==0.13.5 +rsa==3.4.1 +simplejson==3.6.5 +six==1.8.0 +SQLAlchemy==0.7.8 +twilio==3.3.10 +urlgrabber==3.10 +urllib3==1.8.2 +virtualenv==15.1.0 +Werkzeug==0.8.3 +WTForms==1.0.1 +yum-metadata-parser==1.1.4 diff --git a/cron.py b/cron.py index 82f1c23..0aac043 100644 --- a/cron.py +++ b/cron.py @@ -11,7 +11,7 @@ soc = Soc() -EMAIL_SENDER = "Course Sniper " +EMAIL_SENDER = "Course Sniper " Section = namedtuple('Section', ['number', 'index'])