Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*.db
secrets.py
ENV
snipeenv
venv
3 changes: 1 addition & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
app.logger.addHandler(file_handler)

app.wsgi_app = ProxyFix(app.wsgi_app)

app.config['MAIL_SERVER'] = 'smtp.sendgrid.net'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
Expand Down Expand Up @@ -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)
Expand Down
61 changes: 61 additions & 0 deletions check.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]' % (course, index, register_url, url)

Expand Down
5 changes: 2 additions & 3 deletions soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
""" We always use certain parameters"""
self.base_url = 'http://sis.rutgers.edu/soc'
self.params = {
Expand All @@ -17,10 +17,9 @@ def __init__(self, campus='NB', semester='12018', 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' })"""
Expand Down
2 changes: 1 addition & 1 deletion templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% from "_formhelpers.html" import render_field %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<p class="text-center animated fadeIn"> 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. </p>
<p class="text-center animated fadeIn"> 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. </p>
</div>
<div class="col-md-4 col-md-offset-4">
<form method=post action="/">
Expand Down