Exemple #1
0
	def start_stream(self, account: str, stream: TwitterStream, stream_props: dict) -> None:

		"""
		Starts a Twitter stream given an account

		:param account: Twitter account
		:param stream: Twitter stream object
		:param stream_props: Twitter stream start parameters:
			1. Filter term (i.e: 'Golden gate')
			2. Filter coords (i.e: [-74,40,-73,41])
		"""

		# Stopping previous stream in case it existed
		self.stop_stream(account)

		self.set(account, stream)
		stream.start(
			filter_term=stream_props['filter_term'],
			filter_coords=stream_props['filter_coords'],
			filter_langs=('en',),
		)