Exemple #1
0
    def post(self):
        message = xmpp.Message(self.request.POST)

        if message.body == "routes":
            r = Route.get_or_fetch("mbta")
            message.reply(", ".join(r.keys()))
        elif message.body == "@home":
            e = Estimation.get_or_fetch("mbta", "747", "747_0_var0", "1807")
            message.reply(formatter.JSON(e))
        elif message.body == "@office":
            e = Estimation.get_or_fetch("mbta", "747", "747_0_var1", "2231_1")
            message.reply(formatter.JSON(e))
        else:
            message.reply("...")
Exemple #2
0
 def estimations(self, agency_tag, route_tag, direction_tag, stop_tag):
     return formatter.JSON(Estimation.get_or_fetch(agency_tag, route_tag, direction_tag, stop_tag))