Esempio n. 1
0
class Bike:
    def __init__(self):
        self.http_service = HttpService()
        self.producer = Producer()

    def get_bikes_station_information(self, url, params):
        res = self.http_service.get(url, params).json()
        for msg in res['data']['stations']:
            print('bikes_station_information ==>  ', msg)
            self.producer.data_producer(BIKES_STATION_INFORMATION_TOPIC, msg)

    def get_bikes_station_status(self, url, params):
        res = self.http_service.get(url, params).json()
        for msg in res['data']['stations']:
            print('bikes_station_status ==>  ', msg)
            self.producer.data_producer(BIKES_STATION_INFORMATION_TOPIC, msg)