mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-06 10:23:08 +03:00
Added uploaderID monitor
This commit is contained in:
commit
e2bcca0c72
@ -14,7 +14,7 @@
|
||||
"supplyLevel": "Low",
|
||||
"sellPrice": 1138,
|
||||
"demand": 42,
|
||||
"demandLevel": "Med"
|
||||
"demandLevel": "Med",
|
||||
"timestamp": "2014-11-17T12:34:56+00:00"
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
"message": {
|
||||
"systemName": "Eranin",
|
||||
"stationName": "Azeban Orbital",
|
||||
"timestamp": "2014-11-17T12:34:56+00:00"
|
||||
"timestamp": "2014-11-17T12:34:56+00:00",
|
||||
"commodities": [
|
||||
{
|
||||
"name": "Gold",
|
||||
|
@ -51,8 +51,17 @@ class Monitor(Thread):
|
||||
softwareID = json['header']['softwareName'] + ' | ' + json['header']['softwareVersion']
|
||||
|
||||
c = db.cursor()
|
||||
c.execute('UPDATE uploaders SET hits = hits + 1 WHERE `name` = ? AND `dateStats` = ?', (softwareID, currentDate))
|
||||
c.execute('INSERT OR IGNORE INTO uploaders (name, dateStats) VALUES (?, ?)', (softwareID, currentDate))
|
||||
c.execute('UPDATE softwares SET hits = hits + 1 WHERE `name` = ? AND `dateStats` = ?', (softwareID, currentDate))
|
||||
c.execute('INSERT OR IGNORE INTO softwares (name, dateStats) VALUES (?, ?)', (softwareID, currentDate))
|
||||
db.commit()
|
||||
|
||||
|
||||
# Update uploader count
|
||||
uploaderID = json['header']['uploaderID']
|
||||
|
||||
c = db.cursor()
|
||||
c.execute('UPDATE uploaders SET hits = hits + 1 WHERE `name` = ? AND `dateStats` = ?', (uploaderID, currentDate))
|
||||
c.execute('INSERT OR IGNORE INTO uploaders (name, dateStats) VALUES (?, ?)', (uploaderID, currentDate))
|
||||
db.commit()
|
||||
|
||||
|
||||
@ -66,6 +75,7 @@ class Monitor(Thread):
|
||||
|
||||
|
||||
print softwareID
|
||||
print uploaderID
|
||||
print schemaID
|
||||
print currentDate
|
||||
sys.stdout.flush()
|
||||
|
Loading…
x
Reference in New Issue
Block a user