<commit_before># coding: utf-8
from datetime import datetime
import dateutil.parser
from flask import Flask, abort, json, jsonify, make_response, render_template, Response, request, send_from_directory
import hashlib
from flask.ext.moment import Moment

import urllib2
import datetime
import os

from xml.dom.minidom import parseString


stories = {}

def read():
    stories.clear()
    start_Time = datetime.datetime.now()
    file = urllib2.urlopen("http://www.nrk.no/nyheiter/siste.rss")
    data = file.read()
    file.close()
    end_Time = datetime.datetime.now()
    total_Time = end_Time - start_Time
    print(total_Time)
    return parseString(data)



def XMLConvert(parsedData):
    for i in range (1,6):
        
        titleXML = parsedData.getElementsByTagName("title")[i].toxml()
        descriptionXML = parsedData.getElementsByTagName("description")[i].toxml()
        urlXML = parsedData.getElementsByTagName("link")[i].toxml()
        
        titleData = titleXML.replace('<title>','').replace('</title>','')
        descriptionData = descriptionXML.replace('<description>','').replace('</description>','')
        urlData = urlXML.replace('<link>', '').replace('</link>','')

        print(titleData)
        stories.update({titleData:[descriptionData, urlData]})


# Default configuration
DEBUG = True

<commit_msg>Fix URL after NRK silently moved from nynorsk to bokmål URLs<commit_after># coding: utf-8
from datetime import datetime
import dateutil.parser
from flask import Flask, abort, json, jsonify, make_response, render_template, Response, request, send_from_directory
import hashlib
from flask.ext.moment import Moment

import urllib2
import datetime
import os

from xml.dom.minidom import parseString


stories = {}

def read():
    stories.clear()
    start_Time = datetime.datetime.now()
    file = urllib2.urlopen("http://www.nrk.no/nyheter/siste.rss")
    data = file.read()
    file.close()
    end_Time = datetime.datetime.now()
    total_Time = end_Time - start_Time
    print(total_Time)
    return parseString(data)



def XMLConvert(parsedData):
    for i in range (1,6):
        
        titleXML = parsedData.getElementsByTagName("title")[i].toxml()
        descriptionXML = parsedData.getElementsByTagName("description")[i].toxml()
        urlXML = parsedData.getElementsByTagName("link")[i].toxml()
        
        titleData = titleXML.replace('<title>','').replace('</title>','')
        descriptionData = descriptionXML.replace('<description>','').replace('</description>','')
        urlData = urlXML.replace('<link>', '').replace('</link>','')

        print(titleData)
        stories.update({titleData:[descriptionData, urlData]})


# Default configuration
DEBUG = True


{'fraction_non_alphanumeric': 0.13499633162142333, 'fraction_numerical': 0.003668378576669112, 'mean_word_length': 3.9312839059674505, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '2431535', 'n_tokens_mistral': 831, 'n_tokens_neox': 820, 'n_words': 176}