Skip to content

Commit d4aef42

Browse files
committed
added map visualization
1 parent 99630c0 commit d4aef42

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/loklak

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import loklak
55
from pprint import pprint
6+
import os
67

78
parser = argparse.ArgumentParser(description="Python wrapper around the loklak API.")
89
parser.add_argument('-s', '--search', type=str, help='Search API Wrapper which helps to query loklak for JSON results.')
@@ -14,7 +15,7 @@ parser.add_argument('-g', '--geocode', help='Geocode API for geolocation based i
1415
parser.add_argument('-p', '--peers', action='store_true', help='Loklak API for peers connected on the distributed network.')
1516
parser.add_argument('-pg', '--pushgeojson', action='store_true', help='Public API to push geojson objects to the loklak server.')
1617
parser.add_argument('-u', '--user', help='User API to show twitter user information.')
17-
parser.add_argument('-m', '--map', action='store_true', help='Map Visualization render using Loklak service.')
18+
parser.add_argument('-m', '--map', help='Map Visualization render using Loklak service.')
1819
parser.add_argument('-md', '--markdown', action='store_true', help='Markdown conversion API to render markdown as image using Loklak.')
1920
args = parser.parse_args()
2021

@@ -39,7 +40,10 @@ elif args.user:
3940
params = args.user.split()
4041
pprint(loklak.search(*params))
4142
elif args.map:
42-
pass
43+
data = loklak.get_map(args.map.split(',')[0],
44+
args.map.split(',')[1].strip())
45+
with open(os.path.join(os.getcwd(), 'map.png'), 'wb') as f:
46+
f.write(data)
4347
elif args.markdown:
4448
pass
4549
else:

0 commit comments

Comments
 (0)