Python code to upload data to Wikispeedia

If you need an easy way to upload or delete some wikispeedia data, consider python.

This is some python code that might help. Try it, its easy to learn and fun.


———-make sure you indent it properly. Python needs that!——–

# -*- coding: utf-8 -*-

import sqlite3 as lite
import sys
import urllib
import urllib.request
import datetime
from dateutil import parser

con = lite.connect(‘east’)

with con:

cur = con.cursor()
cur.execute(“SELECT * FROM tmp”)

rows = cur.fetchall()

i= len(rows)

for row in rows:
print (str(i))
pointLat =row[0];
pointLon =row[1];
swlat= pointLat-0.00001;
nelat= pointLat+0.00001;
swlng= pointLon-0.00001;
nelng= pointLon+0.00001;
tagg= urllib.parse.quote(tag);
sutcc = parser.parse(sutc)
if dutc is not None:
dutcc= parser.parse(dutc)
dutccc= urllib.parse.quote(dutc)
if dutcc==None:
url = ‘’+’&mlat=’+str(pointLat)+’&mlon=’+str(pointLon)+’&mmph=’+str(mph)+’&mkph=69&mtag=’+tagg+’&mcog=’+str(cog)
elif dutcc is not None:
url = ‘’+str(nelat)+’&swlat=’+str(swlat)+’&nelng=’+str(nelng)+’&swlng=’+str(swlng)+’&mcog=’+str(cog)+’&delmail=’+’’+’&mdutc=’+dutccc

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Road Rage Reduction
TRIPE contest for Collierville Middle school and West Middle School

  Background: Wikispeedia is dedicated to reducing road rage and accidental speeding tickets. We have been around since 2005. We have some real world solutions to reducing road rage. This contest is to excite middle schoolers into the unbelievably challenging and rewarding development of programming. We chose this project because …
Road Rage Reduction
Beluga Whales have less crashes.

According to the ANNENBERG PUBLIC POLICY CENTER, if a Beluga whale could drive, it would have less accidents than perhaps a Narwhal. Why you ask? Because the front of their brain is more developed.   Slower growth in working memory linked to teen driving crashes ANNENBERG PUBLIC POLICY CENTER OF …

Road Rage Reduction
Does this robot make my butt look big?

Got to meet Roxo the robot today. I went early and found the inventor. He lives in Manchester NH where Dean Kamen invented this thing.  Nice 20 something, the face of robots perhaps. He was informative, but here is the jist of the robot…             …