NewsBlur/apps/rss_feeds/management/commands/query_popularity.py
2024-04-24 09:50:42 -04:00

23 lines
755 B
Python

import datetime
import errno
import os
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from apps.reader.models import UserSubscription
from apps.rss_feeds.models import Feed
class Command(BaseCommand):
def add_argument(self, parser):
parser.add_argument("-q", "--query", dest="query", help="Search query")
parser.add_argument("-l", "--limit", dest="limit", type="int", default=1000, help="Limit of stories")
def handle(self, *args, **options):
# settings.LOG_TO_STREAM = True
# Feed.query_popularity(options['query'], limit=options['limit'])
Feed.xls_query_popularity(options["query"], limit=options["limit"])