def run(self, **kwargs):
		today = datetime.date.today()
		for day in range(1, 7): # j+7
			date = today + datetime.timedelta(days=day)
			date = (date.year, date.month, date.day)
			collector = CollectArticles(get_available_channels(), *date, use_storage=True)
			worker.run(collector)
 def run(self, **kwargs):
     today = datetime.date.today()
     for year in range(0, 2):
         date = [today.year + year, None, None]
         collector = CollectArticles(get_available_channels(),
                                     *date,
                                     use_storage=True)
         worker.run(collector)
 def run(self, **kwargs):
     today = datetime.date.today()
     date = (today.year, today.month, today.day)
     collector = CollectArticles(get_available_channels(),
                                 *date,
                                 use_storage=True,
                                 force_collect=True)
     worker.run(collector)
	def run(self, **kwargs):
		today = datetime.date.today()
		for month in range(0,2):
			date      = [None, None, None]
			date[0]   = today.year + (today.month + month) / 12
			date[1]   = (today.month + month - 1) % 12 + 1
			collector = CollectArticles(get_available_channels(), *date, use_storage=True)
			worker.run(collector)
 def test_get_articles_with_queue(self):
     # need to explicitly import the runnable object
     from brokenpromises.operations import CollectArticles
     from brokenpromises.worker import worker
     collector = CollectArticles(("brokenpromises.channels.guardian", ),
                                 "2014",
                                 1,
                                 use_storage=False)
     worker.run(collector)
 def run(self, **kwargs):
     today = datetime.date.today()
     for day in range(1, 7):  # j+7
         date = today + datetime.timedelta(days=day)
         date = (date.year, date.month, date.day)
         collector = CollectArticles(get_available_channels(),
                                     *date,
                                     use_storage=True)
         worker.run(collector)
 def run(self, **kwargs):
     today = datetime.date.today()
     for month in range(0, 2):
         date = [None, None, None]
         date[0] = today.year + (today.month + month) / 12
         date[1] = (today.month + month - 1) % 12 + 1
         collector = CollectArticles(get_available_channels(),
                                     *date,
                                     use_storage=True)
         worker.run(collector)
Exemple #8
0
def search_date(email, year, month=None, day=None):
	date      = (int(year), month and int(month) or None, day and int(day) or None)
	collector = CollectArticlesAndSendEmail(get_available_channels(), *date, use_storage=True, email=email)
	job       = worker.run(collector)
	response  = json.dumps({
		"status"        : "ok",
		"searched_date" : date,
		"ref_job"       : job.id
	})
	return Response(response,  mimetype='application/json')
Exemple #9
0
def search_date(email, year, month=None, day=None):
    date = (int(year), month and int(month) or None, day and int(day) or None)
    collector = CollectArticlesAndSendEmail(get_available_channels(),
                                            *date,
                                            use_storage=True,
                                            email=email)
    job = worker.run(collector)
    response = json.dumps({
        "status": "ok",
        "searched_date": date,
        "ref_job": job.id
    })
    return Response(response, mimetype='application/json')
	def test_get_articles_with_queue(self):
		# need to explicitly import the runnable object
		from brokenpromises.operations import CollectArticles
		from brokenpromises.worker     import worker
		collector = CollectArticles(("brokenpromises.channels.guardian",), "2014", 1, use_storage=False)
		worker.run(collector)
	def run(self, **kwargs):
		today = datetime.date.today()
		for year in range(0,2):
			date      = [today.year + year, None, None]
			collector = CollectArticles(get_available_channels(), *date, use_storage=True)
			worker.run(collector)
	def run(self, **kwargs):
		today     = datetime.date.today()
		date      = (today.year, today.month, today.day)
		collector = CollectArticles(get_available_channels(), *date, use_storage=True, force_collect=True)
		worker.run(collector)