<commit_before><commit_msg>Starting a class for managing Blog data<commit_after>
import configparser
import os
import feedparser

class BlogData():

    def __init__(self):
         self.rssFeed = ''
         self.socialNetworks = {}
         self.linksToAvoid = ""
         self.posts = []
         self.time = []
 
    def getRssFeed(self):
        return(self.rssFeed)

    def setRssFeed(self, feed):
        self.rssFeed = feed

    def getSocialNetworks(self):
        return(self.socialNetworks)
 
    def addSocialNetwork(self, socialNetwork):
        self.socialNetworks[socialNetwork[0]] = socialNetwork[1]
 
    def getLinksToAvoid(self):
        return(self.linksToAvoid)
 
    def setLinksToAvoid(self,linksToAvoid):
        self.linksToAvoid = linksToAvoid
 
    def getTime(self):
        return(self.time)
 
    def setTime(self, time):
        self.time = time

    def getBlogEntries(self):

if __name__ == "__main__":

    import BlogData
    
    config = configparser.ConfigParser()
    config.read([os.path.expanduser('~/.rssBlogs')])

    print("Configured blogs:")

    blogs = []

    for section in config.sections():
        rssFeed = config.get(section, "rssFeed")
        blog = BlogData.BlogData()
        blog.setRssFeed(rssFeed)
        if ("linksToAvoid" in config.options(section)):
            blog.setLinksToAvoid(config.get(section, "linksToAvoid"))
        if ("time" in config.options(section)):
            blog.setTime(config.get(section, "time"))

        for option in config.options(section):
            if ('ac' in option) or ('fb' in option):
                blog.addSocialNetwork((option, config.get(section, option)))
        blogs.append(blog)

    for blog in blogs:
        print(blog.getRssFeed())
        print(blog.getSocialNetworks())

{'fraction_non_alphanumeric': 0.11669458403126745, 'fraction_numerical': 0.0011166945840312675, 'mean_word_length': 2.6129032258064515, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, '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': '1586269', 'n_tokens_mistral': 560, 'n_tokens_neox': 528, 'n_words': 110}