Пример #1
0
 def pokemon_alert(self, pokemon):
     notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
     google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
     time_text = pkmn_time_text(pokemon['disappear_time'])
     self.client.sendMessage(self.channel,
                             '<b>' + notification_text + '</b> \n' + google_maps_link + '\n' + time_text,
                             parse_mode='HTML', disable_web_page_preview='False')
Пример #2
0
	def pokemon_alert(self, pokemon):
                user_icon = ':pokemon-' + pokemon['name'].lower() + ':'
                address = Nominatim().reverse(str(pokemon["lat"])+", "+str(pokemon["lng"])).address
		notification_text = pokemon['name'].title() + " found!"
		google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
		time_text =  pkmn_time_text(pokemon['disappear_time']) + "  Address: " + address + "."
		output_text = '<{}|{}> {}'.format(google_maps_link, notification_text , time_text)
		self.client.chat.post_message(self.channel, output_text, username=pokemon['name'], icon_emoji=user_icon)
Пример #3
0
	def pokemon_alert(self, pokemon):
		#notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
		# Or retrieve a channel by its channel_tag. Note that an InvalidKeyError is raised if the channel_tag does not exist
		#your pushbullet channelname
		my_channel = self.client.get_channel('YOURCHANNELNAME') 
		
		google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
		time_text =  pkmn_time_text(pokemon['disappear_time'])
		notification_text = "("+ pokemon['name'].title() + " found" +"! "+" "  + time_text + "."
		push = self.client.push_link(notification_text, google_maps_link, body=time_text)
		#send to channel
		push = self.client.push_link(notification_text, google_maps_link, body=time_text, channel=my_channel)
Пример #4
0
 def pokemon_alert(self, pokemon):
     notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
     google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
     time_text = pkmn_time_text(pokemon['disappear_time'])
     push = self.client.push_link(notification_text, google_maps_link, body=time_text)
Пример #5
0
	def pokemon_alert(self, pokemon):
                address = Nominatim().reverse(str(pokemon["lat"])+", "+str(pokemon["lng"])).address
		notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
		google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
		time_text =  pkmn_time_text(pokemon['disappear_time']) + "  Address: " + address + "."
		push = self.client.push_link(notification_text, google_maps_link, body=time_text)
Пример #6
0
 def pokemon_alert(self, pokemon):
     notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
     google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
     time_text = pkmn_time_text(pokemon['disappear_time'])
     self.send_sms(notification_text + " " + time_text + " " + google_maps_link)
Пример #7
0
	def pokemon_alert(self, pokemon):
		notification_text = "A wild " + pokemon['name'].title() + " has appeared!"
		google_maps_link = gmaps_link(pokemon["lat"], pokemon["lng"])
		time_text =  pkmn_time_text(pokemon['disappear_time'])
		self.client.chat.post_message(self.channel, notification_text + " " + time_text + " " + google_maps_link)