<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import requests\n",
    "import smtplib\n",
    "from time import sleep"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "[\n",
    "    ('ECE','340','56895'),\n",
    "    ('CS','498','65685')\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def alert(address, course):\n",
    "    ADDR = \"<EMAIL>\"\n",
    "    passw = \"<PASSWORD>!\"\n",
    "\n",
    "    content = (course[0] + ' ' + course[1] + ', CRN: ' + course[2] + ', is available')\n",
    "    \n",
    "    mail = smtplib.SMTP('smtp.gmail.com',587)\n",
    "    mail.ehlo()\n",
    "    mail.starttls()\n",
    "    mail.login(ADDR,passw)\n",
    "    mail.sendmail(ADDR,address,content) \n",
    "    mail.close()\n",
    "    print(\"Sent \" + content[0])\n",
    "    sleep(60*10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "while True:\n",
    "    a = requests.get('http://courses.illinois.edu/cisapp/explorer/schedule/2017/spring/ECE/340/56895.xml', auth=()).text\n",
    "    if u'Closed' in a:\n",
    "        print('closed')\n",
    "    else:\n",
    "        print('OPEN: 56895')\n",
    "        alert()\n",
    "    sleep(60*5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []<commit_msg>woops email<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import requests\n",
    "import smtplib\n",
    "from time import sleep\n",
    "from numpy import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "courses = [\n",
    "    ('ECE','340','56895'),\n",
    "    ('CS','498','65685')\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def alert(address, course):\n",
    "    ADDR = \"<EMAIL>\"\n",
    "    passw = \"<PASSWORD>\"\n",
    "\n",
    "    content = (course[0] + ' ' + course[1] + ', CRN: ' + course[2] + ', is available')\n",
    "    \n",
    "    mail = smtplib.SMTP('smtp.gmail.com',587)\n",
    "    mail.ehlo()\n",
    "    mail.starttls()\n",
    "    mail.login(ADDR,passw)\n",
    "    mail.sendmail(ADDR,address,content) \n",
    "    mail.close()\n",
    "    print(\"Sent \" + content[0])\n",
    "    sleep(60*10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "while True:\n",
    "    a = requests.get('http://courses.illinois.edu/cisapp/explorer/schedule/2017/spring/ECE/340/56895.xml', auth=()).text\n",
    "    if u'Closed' in a:\n",
    "        print('closed')\n",
    "    else:\n",
    "        print('OPEN: 56895')\n",
    "        alert()\n",
    "    sleep(60*5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "255"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "15*random.poisson(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
{'fraction_non_alphanumeric': 0.23917371826779493, 'fraction_numerical': 0.027625684420109507, 'mean_word_length': 2.108275328692962, 'pattern_counts': {'":': 79, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5119424', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1574, 'n_words': 233}