<commit_before>from ..utils import Scraper
from bs4 import BeautifulSoup
from collections import OrderedDict
import json
import os
import requests


class UTMCalendar:

    host = 'http://www.artsandscience.utoronto.ca/ofr/calendar/'

    @staticmethod
    def scrape(location='.'):
        Scraper.logger.info('UTMCalendar initialized.')
        Scraper.logger.info('Not implemented.')
        Scraper.logger.info('UTMCalendar completed.')<commit_msg>initial commit<commit_after>from ..utils import Scraper
from bs4 import BeautifulSoup
from collections import OrderedDict
import json
import os
import requests
import datetime
now = datetime.datetime.now()


class UTMCalendar:

    host1 = 'http://m.utm.utoronto.ca/importantDates.php?mode=full&session={0}5&header='
    host2 = 'http://m.utm.utoronto.ca/importantDates.php?mode=full&session={0}9&header='

    @staticmethod
    def scrape(location='.', year=None):
        year = year or now.year

        Scraper.logger.info('UTMCalendar initialized.')

        html = Scraper.get(UTMCalendar.host1.format(year))
        soup = BeautifulSoup(html, 'html.parser')
        content = soup.find('div', class_='content')
        dates = content.find_all('div', class_='title')
        i = 0
        currentDate = dates[i]
        while(i<len(dates)):
            print(dates[i].text)

            while (currentDate == dates[i]):
                info = dates[i].find_next('div', class_='info')
                print(info.text)
                i+=1
                if(i>=len(dates)):
                    break;
            if(i<len(dates)):
                currentDate = dates[i]



        Scraper.logger.info('UTMCalendar completed.')
{'fraction_non_alphanumeric': 0.12648456057007126, 'fraction_numerical': 0.006532066508313539, 'mean_word_length': 2.72787610619469, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '4213165', 'n_tokens_mistral': 524, 'n_tokens_neox': 496, 'n_words': 101}