<commit_before>'''
Created on Sep 24, 2014

@author: <NAME>
'''

import urllib2
from bs4 import BeautifulSoup
import sys
import re

reload(sys)
sys.setdefaultencoding("utf-8")

class GameData(object):
   def __init__(self, link, headline):
      self.link = link
      self.headline = headline
      
   def char_convert_link(self, link):
      self.link = re.sub('[&]', '&amp;', self.link)
   

def extract_game_data():
   games = []
#   w = open("out.txt", 'w')
   response = urllib2.urlopen("http://espn.go.com/nhl/team/schedule/_/name/pit/pittsburgh-penguins")
   page_source = response.read()
   soup = BeautifulSoup(page_source)
   
   for div in soup.find_all(attrs={"class" : "score"}):
      complete_link = "http://espn.go.com" + str(div.find('a').get('href').encode('utf-8', 'ignore'))
      print complete_link

      new_game = GameData(complete_link, get_game_headline(complete_link))
      new_game.char_convert_link(new_game.link)
      games.append(new_game)
      
   return games
<commit_msg>current script<commit_after>'''
Created on Sep 24, 2014

@author: <NAME>
'''

import urllib2
from bs4 import BeautifulSoup
import sys
import re

reload(sys)
sys.setdefaultencoding("utf-8")

class GameData(object):
   def __init__(self, link, headline):
      self.link = link
      self.headline = headline
      
   def char_convert_link(self, link):
      self.link = re.sub('[&]', '&amp;', self.link)
   

def extract_game_data():
   games = []
#   w = open("out.txt", 'w')
   response = urllib2.urlopen("http://espn.go.com/nhl/team/schedule/_/name/pit/pittsburgh-penguins")
   page_source = response.read()
   soup = BeautifulSoup(page_source)
   
   for div in soup.find_all(attrs={"class" : "score"}):
      complete_link = "http://espn.go.com" + str(div.find('a').get('href').encode('utf-8', 'ignore'))
#      print complete_link

      new_game = GameData(complete_link, get_game_headline(complete_link))
      new_game.char_convert_link(new_game.link)
      games.append(new_game)
      
   return games

{'fraction_non_alphanumeric': 0.15069169960474307, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 3.6232876712328768, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6294456', 'n_tokens_mistral': 735, 'n_tokens_neox': 718, 'n_words': 135}