Skip to content

Commit f5083fa

Browse files
committed
Merge pull request #11 from yasoob/master
implemented the get_markdown method
2 parents ea4165a + e4231b0 commit f5083fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

loklak.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ def get_map(self, latitude, longitude, width=500, height=500,
7474
else:
7575
return ''
7676

77+
def get_markdown(self, text, color_text="000000", color_bg="ffffff",
78+
padding="10", uppercase="true"):
79+
"""Returns a map of size 500x500"""
80+
map_application = 'vis/markdown.png'
81+
params = {'text': text, 'color_text': color_text, 'color_background': color_bg,
82+
'padding': padding, 'uppercase': uppercase}
83+
return_to_user = requests.get(self.baseUrl + map_application,
84+
params=params, stream=True)
85+
if return_to_user.status_code == 200:
86+
return return_to_user.raw.read()
87+
else:
88+
return ''
89+
7790
def peers(self):
7891
"""Gives the peers of a user"""
7992
peers_application = 'api/peers.json'

0 commit comments

Comments
 (0)