Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:pyrovski/Google-Maps-heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bailey committed Jun 30, 2010
2 parents 9f959da + 8f46410 commit e5b3c63
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions populateSQL.py
@@ -0,0 +1,38 @@
#!/usr/bin/env python
import MySQLdb
from datetime import datetime
from os import system


system("rm show30")
system("wget http://maps.azstarnet.com/crime/show30 > /dev/null")
system("./extract show30 > /dev/null")
system("rm show30")



'''
db = MySQLdb.connect(\
host="localhost",\
user="GoogleHeatMap",\
passwd="7ynMELdb",\
db="GoogleHeatMap")
c = db.cursor()
for item in d['entries']:
summary = item['summary']
title = item['title']
author = item['author']
webURL = item['id']
c.execute ("""
SELECT URL FROM Abstracts WHERE URL=%s""", (webURL))
if c.fetchone() == None:
c.execute ("""
INSERT INTO Abstracts (URL, Title, Authors, Summary)
VALUES (%s, %s, %s, %s)""",\
(webURL, title, author, summary))
c.close ()
db.close ()
'''

0 comments on commit e5b3c63

Please sign in to comment.