Пример #1
0
	def __init__(self, feed_iter, post_list):
		self._feed_iter = feed_iter
		self._post_list = post_list
		self._window = []
		
		try:
			self.since = self._post_list[0].timestamp
			self.until = self._post_list[-1].timestamp
		except IndexError:
			self.since = self.until = TimestampFactory.make_timestamp()
Пример #2
0
	def _load(self, *args):
		now = TimestampFactory.make_timestamp()
		
		feed_json,since,until = _Load.run(self,*args)
		since = TimestampFactory.from_seconds(since)
		until = TimestampFactory.from_seconds(until)
		while not feed_json["data"] and until < now:
			args = [until.as_seconds()]
			feed_json,since,until = _Load.run(self,*args)
			since = TimestampFactory.from_seconds(since)
			until = TimestampFactory.from_seconds(until)

		return FeedFactory.make_feed(feed_json)