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.

link

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

#!/usr/bin/python
# -*- 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:
i=i-1
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;
cog=row[2];
mph=row[3];
deletedon=row[4];
submittedon=row[5];
kph=row[6];
sutc=row[7];
dutc=row[8];
tag=row[9];
tagg= urllib.parse.quote(tag);
mph_truck=row[10]
web_local=row[11]
sutcc = parser.parse(sutc)
dutcc=None
if dutc is not None:
dutcc= parser.parse(dutc)
dutccc= urllib.parse.quote(dutc)
if dutcc==None:
url = ‘http://www.wikispeedia.org/a/process_submit_bb3.php?name=all’+’&mlat=’+str(pointLat)+’&mlon=’+str(pointLon)+’&mmph=’+str(mph)+’&mkph=69&mtag=’+tagg+’&mcog=’+str(cog)
urllib.request.urlopen(url).read()
elif dutcc is not None:
url = ‘http://www.wikispeedia.org/a/delete_bb4a.php?nelat=’+str(nelat)+’&swlat=’+str(swlat)+’&nelng=’+str(nelng)+’&swlng=’+str(swlng)+’&mcog=’+str(cog)+’&delmail=’+’gpscruise@gmail.com’+’&mdutc=’+dutccc
urllib.request.urlopen(url).read()

0 Shares
Road Rage Reduction
TRIPE Winners: First Place: Ahmad Issa, 2nd Place: Emerson Pruett

Congrats to all 20+ people who registered here for this challenge. It was definitely not easy. Two people asked questions on Discord and got answers. This led them to two videos which showed a possible route to a solution. One solution is to find similar code on github and get …

https://www.wikispeedia.org/wordpress/tripe-contest-for-collierville-middle-school-and-west-middle-school/
Road Rage Reduction
1
Tripe Contest ends Dec 13, 2019

If you registered here, then you are a contestant! For all who entered this contest, I hope you have carved out a few minutes to try it.You need to submit something to gpscruise@gmail.com by Dec 13. Your submission can be a text description of what you did. Anything.. It won’t …

Road Rage Reduction
2
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 no …