<commit_before>from djpubsubhubbub.signals import updated

from .models import Feed, FeedEntry


def update_handler(sender, update, **kwargs):
    """
    Process new content being provided from SuperFeedr

    """

    feeds = Feed.objects.filter(feed_url=sender.topic)

    for feed in feeds:
        for entry in update.entries:
            feed_entry, created = FeedEntry.objects.get_or_create(
                link=entry['link'],
                feed=feed,
                defaults={
                    'title': entry['title'],
                    'summary': entry['summary']
                }
            )

            if created:
                feed_entry.add_to_kipt()

updated.connect(update_handler, dispatch_uid='superfeedr')<commit_msg>Debugging print of Superfeedr entries<commit_after>from djpubsubhubbub.signals import updated

from .models import Feed, FeedEntry


def update_handler(sender, update, **kwargs):
    """
    Process new content being provided from SuperFeedr

    """

    feeds = Feed.objects.filter(feed_url=sender.topic)

    for feed in feeds:
        for entry in update.entries:
            print entry
            feed_entry, created = FeedEntry.objects.get_or_create(
                link=entry['link'],
                feed=feed,
                defaults={
                    'title': entry['title'],
                    'summary': entry['summary']
                }
            )

            if created:
                feed_entry.add_to_kipt()

updated.connect(update_handler, dispatch_uid='superfeedr')
{'fraction_non_alphanumeric': 0.09290322580645162, 'fraction_numerical': 0.0, 'mean_word_length': 1.965583173996176, 'pattern_counts': {'":': 0, '<': 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': '313869', 'n_tokens_mistral': 434, 'n_tokens_neox': 401, 'n_words': 95}