<commit_before>#!/usr/bin/env python
"""
osu.py - Jenni OSU Module
Copyright 2011, <NAME>, yanovich.net
Licensed under the Eiffel Forum License 2.

http://inamidst.com/phenny/

The module contains various functions specific to The Ohio State University.
"""

import web, re

re_find_status = re.compile(r'(?ims)(<br>[\d\w\s\.]+(columbus|canceled)[\d\w\s\.]+(columbus|canceled)[\w\d\s\.]+<br>)')
r_tag = re.compile(r'<(?!!)[^>]+>')

def osu_classes (jenni, input):
    a = web.get("http://ap.osu.edu/emergency/default.aspx")
    msg = ""
    try:
        b = re_find_status.findall(a)
        msg = b[0][0]
        msg = r_tag.sub('', msg)
    except:
        msg = "No information can be found about classes being cancelled at The Ohio State University."
    msg += " - %s" % ("Verify at http://go.osu.edu/emergency or call 614-247-7777.")
    jenni.say(msg)
osu_classes.commands = ['osu']
osu_classes.priority = 'high'

def office(jenni, input):
    site = web.get("http://web2/~meinwald/office.php")
    lines = site.split('\n')
    jenni.reply(lines[2])
office.commands = ['office']
<commit_msg>Added an try except so the .office should work from different hosts.<commit_after>#!/usr/bin/env python
"""
osu.py - Jenni OSU Module
Copyright 2011, <NAME>, yanovich.net
Licensed under the Eiffel Forum License 2.

http://inamidst.com/phenny/

The module contains various functions specific to The Ohio State University.
"""

import web, re

re_find_status = re.compile(r'(?ims)(<br>[\d\w\s\.]+(columbus|canceled)[\d\w\s\.]+(columbus|canceled)[\w\d\s\.]+<br>)')
r_tag = re.compile(r'<(?!!)[^>]+>')

def osu_classes (jenni, input):
    a = web.get("http://ap.osu.edu/emergency/default.aspx")
    msg = ""
    try:
        b = re_find_status.findall(a)
        msg = b[0][0]
        msg = r_tag.sub('', msg)
    except:
        msg = "No information can be found about classes being cancelled at The Ohio State University."
    msg += " - %s" % ("Verify at http://go.osu.edu/emergency or call 614-247-7777.")
    jenni.say(msg)
osu_classes.commands = ['osu']
osu_classes.priority = 'high'

def office(jenni, input):
    try:
        site = web.get("http://opensource.osu.edu/~meinwald/office.php")
    except:
        site = web.get("http://web2/~meinwald/office.php")
    lines = site.split('\n')
    jenni.reply(lines[2])
office.commands = ['office']

{'fraction_non_alphanumeric': 0.18177948063005533, 'fraction_numerical': 0.016177096636866752, 'mean_word_length': 3.32780847145488, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2587797', 'n_tokens_mistral': 926, 'n_tokens_neox': 874, 'n_words': 195}