kurtmckee/feedparser

Summary overwritting content

Opened this issue · 0 comments

I am looking to pull the entirety of an articles content so that I can summarize it using ChatGPT. However, for every entry it appears that content is populated with the same small excerpt from the article that is contained within the summary key.

For example when pulling from this url
I get this output inside of content:
'... <b>Boehringer Ingelheim</b>, and others. Promising Diabetic Retinopathy Pipeline Therapies in the various stages of development include Runcaciguat&nbsp;...'

The following is the code that I am using, with self.urls simply being a list of RSS feeds that I am trying to parse.

def grab_content(self, inclusions=None):
        cleaned_list = []
        for feed in self.urls:
            data = parse(feed)
            entries = data['entries']
            for content in entries:
                url, title, date, body = (content['link'].split('url=')[1], cleanhtml(content['title']),
                                          content['published_parsed'], cleanhtml(content['content'][0].value))
                test = content
                if inclusions:
                    if any(exc in title for exc in inclusions) or any(exc in body for exc in inclusions):
                        if "publisher" in content:
                            publisher = content['publisher']
                        else:
                            publisher = None
                        new_article = Article(title, date, body.split('. ')[:4], url, publisher)
                        cleaned_list.append(new_article)
        self.articles += cleaned_list

Please let me know if I am doing anything wrong as I have tried to follow the documentation as best as possible.

Thanks,
Otis