Created
May 23, 2012 16:08
-
-
Save redacted/2776134 to your computer and use it in GitHub Desktop.
extract lat longs from localstorage db
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import sys | |
def get_latlngs(fname): | |
latlngs = [] | |
conn = sqlite3.connect(fname) | |
c = conn.cursor() | |
c.execute("select * from ItemTable") | |
all_entries = c.fetchall() | |
for entry in all_entries: | |
if "latLng" in entry[0]: | |
latlngs.append(str(entry[1]).replace("\x00", "")) | |
return latlngs | |
if __name__ == "__main__": | |
try: | |
db_name = sys.argv[1] | |
except: | |
print "provide localstorage db as argument" | |
raise SystemExit | |
print get_latlngs(db_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment