Scipts added
This commit is contained in:
parent
c02733b3ab
commit
e309f9d4c1
39
biggestDownVote7d.js
Normal file
39
biggestDownVote7d.js
Normal file
@ -0,0 +1,39 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$sort': {
|
||||
'ts': -1
|
||||
}
|
||||
}, {
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'votes.vt': 1
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'votes.claimed': null
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'ts': {
|
||||
'$gt': Date.now()-604800000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$limit': 10
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'contents', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
element.claims=Math.floor(element.claims/100)
|
||||
console.log({id: element._id,vote: element.votes})
|
||||
})
|
||||
})
|
39
biggestUpVote7d.js
Normal file
39
biggestUpVote7d.js
Normal file
@ -0,0 +1,39 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$sort': {
|
||||
'ts': -1
|
||||
}
|
||||
}, {
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'votes.vt': -1
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'votes.claimed': null
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'ts': {
|
||||
'$gt': Date.now()-604800000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$limit': 10
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'contents', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
element.claims=Math.floor(element.claims/100)
|
||||
console.log({id: element._id,vote: element.votes})
|
||||
})
|
||||
})
|
5
config.js
Normal file
5
config.js
Normal file
@ -0,0 +1,5 @@
|
||||
config = {
|
||||
mongoUrl: "mongodb://10.0.0.2",
|
||||
}
|
||||
|
||||
module.exports = config
|
73
downvotEearnedVsUpvoteperforNannal.js
Normal file
73
downvotEearnedVsUpvoteperforNannal.js
Normal file
@ -0,0 +1,73 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
approx = require("approximate-number")
|
||||
|
||||
userlist = ['nannal',"shitpostbapper",'clean-mink-255','drab-wasp-918','russel-similar-955','monkey-extra-small-439','burmese-metallic-102','toad-wealthy-859','gorilla-uncommon-408','bandicoot-pesky-709','woodpecker-harmless-984','gorilla-idle-769','gibbon-harmless-779','moth-trained-424','dane-barren-384','born2peeforced2aim','b4963559-4b5c-4a33-a604-ef72fc3f11a7','03934fdc-e41a-47a9-9a31-6caf645247c2','1d49e3e7-2160-46e7-a1a6-dc97cba60cce','02807c99-04c8-4318-8dd7-5946cec71860','87b8ac3a-9cac-4a2e-a06d-86b30138b510','133ca83c-0d1f-41d9-a3e2-18a42be998b4','e6b3ccd2-f4dd-425f-9d40-3824c08804db','e009da63-68a3-4c97-a655-d5152fdb7e84','d1df4b0f-0872-4ec5-a3c4-721391d6214d']
|
||||
|
||||
orArr = []
|
||||
|
||||
userlist.forEach(element => {
|
||||
orArr.push({'votes.u': element})
|
||||
})
|
||||
|
||||
|
||||
dAgg = [
|
||||
{
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
$or: orArr
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'votes.vt': {
|
||||
'$lt': 0
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
uAgg = [
|
||||
{
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
$or: orArr
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'votes.vt': {
|
||||
'$gt': 0
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
dClaimed = 0
|
||||
dVt = 0
|
||||
mongo.aggregate('avalon5', 'contents', dAgg).then(res => {
|
||||
res.forEach(element => {
|
||||
dClaimed = dClaimed+element.votes.claimable
|
||||
dVt = dVt+(element.votes.vt*-1)
|
||||
})
|
||||
console.log("Down, ",dVt,dClaimed/100,(dClaimed/100)/dVt)
|
||||
console.log("Down aprox, ",approx(dVt),approx(dClaimed/100))
|
||||
})
|
||||
|
||||
|
||||
uClaimed = 0
|
||||
uVt = 0
|
||||
mongo.aggregate('avalon5', 'contents', uAgg).then(res => {
|
||||
res.forEach(element => {
|
||||
uClaimed = uClaimed+element.votes.claimable
|
||||
uVt = uVt+(element.votes.vt)
|
||||
})
|
||||
console.log("Up, ",uVt,uClaimed/100,(uClaimed/100)/uVt)
|
||||
console.log("Up aprox, ",approx(uVt),approx(uClaimed/100))
|
||||
})
|
30
getDTubeTransfersover1k.js
Normal file
30
getDTubeTransfersover1k.js
Normal file
@ -0,0 +1,30 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$unwind': {
|
||||
'path': '$txs',
|
||||
'preserveNullAndEmptyArrays': true
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'txs.sender': 'dtube'
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'txs.type': 3
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'txs.data.amount': {
|
||||
'$gt': 10000
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'blocks', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
console.log(element.timestamp, element.txs.data.receiver,element.txs.data.amount,element.txs.data.memo)
|
||||
})
|
||||
})
|
58
mongoHelp.js
Normal file
58
mongoHelp.js
Normal file
@ -0,0 +1,58 @@
|
||||
var MongoClient = require('mongodb').MongoClient
|
||||
config = require("./config")
|
||||
|
||||
url = config.mongoUrl
|
||||
var options= {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true}
|
||||
|
||||
|
||||
function put(db,collection, object){
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
client.db(db).collection(collection).insertOne(object).then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
exports.put = put
|
||||
|
||||
function get(db, collection, object){
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
return client.db(db).collection(collection).find(object).toArray().then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
exports.get = get
|
||||
|
||||
function getUnique(db, collection, field,object){
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
return client.db(db).collection(collection).distinct(field,object).then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
|
||||
exports.getUnique = getUnique
|
||||
|
||||
function aggregate(db,collection,agg){
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
return client.db(db).collection(collection).aggregate(agg).batchSize(10000000000000).maxTimeMS(1000000).toArray().then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
exports.aggregate = aggregate
|
||||
|
||||
function deleteOne(db, collection, object) {
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
client.db(db).collection(collection).deleteOne(object).then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
exports.deleteOne = deleteOne
|
||||
|
||||
function update(db, collection, search,update) {
|
||||
const client = new MongoClient(url, options)
|
||||
client.connect()
|
||||
client.db(db).collection(collection).updateOne(search,{$set:update}).then((value) =>{client.close();return value})
|
||||
}
|
||||
|
||||
exports.update = update
|
||||
|
353
package-lock.json
generated
Normal file
353
package-lock.json
generated
Normal file
@ -0,0 +1,353 @@
|
||||
{
|
||||
"name": "avalonmonoscripts",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "avalonmonoscripts",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"approximate-number": "^2.1.0",
|
||||
"mongodb": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz",
|
||||
"integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A=="
|
||||
},
|
||||
"node_modules/@types/webidl-conversions": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz",
|
||||
"integrity": "sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q=="
|
||||
},
|
||||
"node_modules/@types/whatwg-url": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz",
|
||||
"integrity": "sha512-2YubE1sjj5ifxievI5Ge1sckb9k/Er66HyR2c+3+I6VDUUg1TLPdYYTEbQ+DjRkS4nTxMJhgWfSfMRD2sl2EYQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/webidl-conversions": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/approximate-number": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/approximate-number/-/approximate-number-2.1.0.tgz",
|
||||
"integrity": "sha512-EioK6nto/hEnwaJ7d/TG1WOZ9o0zTyIFVP4Lk7zzR/3I4O7ivkBNo7EvLC2Xh2j2HD/cb9sUqXHdexfGXCXYDA=="
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/bson": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bson/-/bson-4.5.0.tgz",
|
||||
"integrity": "sha512-WoSOKryfrKx0aqhPz/DJsUlrMlOL+hkW+469Q5z5E/EQWF2xilOH7h/s5HH4j9iLRzVDwKFwVNQ3Mba16srmlw==",
|
||||
"dependencies": {
|
||||
"buffer": "^5.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
|
||||
"integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"node_modules/memory-pager": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
|
||||
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/mongodb": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.1.0.tgz",
|
||||
"integrity": "sha512-Gx9U9MsFWgJ3E0v4oHAdWvYTGBznNYPCkhmD/3i/kPTY/URnPfHD5/6VoKUFrdgQTK3icFiM9976hVbqCRBO9Q==",
|
||||
"dependencies": {
|
||||
"bson": "^4.4.0",
|
||||
"denque": "^1.5.0",
|
||||
"mongodb-connection-string-url": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.9.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"saslprep": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mongodb-connection-string-url": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-1.1.2.tgz",
|
||||
"integrity": "sha512-mp5lv4guWuykOpkwNNqQ0tKKytuJUjL/aC/bu/DqoJVWL5NSh4j/u+gJ+EiOdweLujHyq6JZZqcTVipHhL5xRg==",
|
||||
"dependencies": {
|
||||
"@types/whatwg-url": "^8.0.0",
|
||||
"whatwg-url": "^8.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/saslprep": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
|
||||
"integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"sparse-bitfield": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/sparse-bitfield": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
|
||||
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"memory-pager": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
|
||||
"integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
|
||||
"dependencies": {
|
||||
"punycode": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
|
||||
"engines": {
|
||||
"node": ">=10.4"
|
||||
}
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "8.7.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz",
|
||||
"integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==",
|
||||
"dependencies": {
|
||||
"lodash": "^4.7.0",
|
||||
"tr46": "^2.1.0",
|
||||
"webidl-conversions": "^6.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "16.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz",
|
||||
"integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A=="
|
||||
},
|
||||
"@types/webidl-conversions": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz",
|
||||
"integrity": "sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q=="
|
||||
},
|
||||
"@types/whatwg-url": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz",
|
||||
"integrity": "sha512-2YubE1sjj5ifxievI5Ge1sckb9k/Er66HyR2c+3+I6VDUUg1TLPdYYTEbQ+DjRkS4nTxMJhgWfSfMRD2sl2EYQ==",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"@types/webidl-conversions": "*"
|
||||
}
|
||||
},
|
||||
"approximate-number": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/approximate-number/-/approximate-number-2.1.0.tgz",
|
||||
"integrity": "sha512-EioK6nto/hEnwaJ7d/TG1WOZ9o0zTyIFVP4Lk7zzR/3I4O7ivkBNo7EvLC2Xh2j2HD/cb9sUqXHdexfGXCXYDA=="
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
|
||||
},
|
||||
"bson": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bson/-/bson-4.5.0.tgz",
|
||||
"integrity": "sha512-WoSOKryfrKx0aqhPz/DJsUlrMlOL+hkW+469Q5z5E/EQWF2xilOH7h/s5HH4j9iLRzVDwKFwVNQ3Mba16srmlw==",
|
||||
"requires": {
|
||||
"buffer": "^5.6.0"
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
"requires": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"denque": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
|
||||
"integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw=="
|
||||
},
|
||||
"ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"memory-pager": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
|
||||
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
|
||||
"optional": true
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.1.0.tgz",
|
||||
"integrity": "sha512-Gx9U9MsFWgJ3E0v4oHAdWvYTGBznNYPCkhmD/3i/kPTY/URnPfHD5/6VoKUFrdgQTK3icFiM9976hVbqCRBO9Q==",
|
||||
"requires": {
|
||||
"bson": "^4.4.0",
|
||||
"denque": "^1.5.0",
|
||||
"mongodb-connection-string-url": "^1.0.1",
|
||||
"saslprep": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"mongodb-connection-string-url": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-1.1.2.tgz",
|
||||
"integrity": "sha512-mp5lv4guWuykOpkwNNqQ0tKKytuJUjL/aC/bu/DqoJVWL5NSh4j/u+gJ+EiOdweLujHyq6JZZqcTVipHhL5xRg==",
|
||||
"requires": {
|
||||
"@types/whatwg-url": "^8.0.0",
|
||||
"whatwg-url": "^8.4.0"
|
||||
}
|
||||
},
|
||||
"punycode": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||
},
|
||||
"saslprep": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
|
||||
"integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"sparse-bitfield": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"sparse-bitfield": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
|
||||
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"memory-pager": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
|
||||
"integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
|
||||
"requires": {
|
||||
"punycode": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "8.7.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz",
|
||||
"integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==",
|
||||
"requires": {
|
||||
"lodash": "^4.7.0",
|
||||
"tr46": "^2.1.0",
|
||||
"webidl-conversions": "^6.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
package.json
Normal file
19
package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "avalonmonoscripts",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "config.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.nannal.com/nannal/AvalonMonoScripts"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"approximate-number": "^2.1.0",
|
||||
"mongodb": "^4.1.0"
|
||||
}
|
||||
}
|
35
tipsLessThan20SinceAugust16th.js
Normal file
35
tipsLessThan20SinceAugust16th.js
Normal file
@ -0,0 +1,35 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
// August 16th 2021
|
||||
// 1629061200000
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$unwind': {
|
||||
'path': '$txs',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'timestamp': {
|
||||
'$gt': 1629061200000
|
||||
}
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'txs.type': 19
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'txs.data.tip': {
|
||||
'$lt': 20
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'blocks', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
console.log(element)
|
||||
})
|
||||
})
|
41
totalClaimedPerUser.js
Normal file
41
totalClaimedPerUser.js
Normal file
@ -0,0 +1,41 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$sort': {
|
||||
'ts': -1
|
||||
}
|
||||
}, {
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'votes.u': 1
|
||||
}
|
||||
}, {
|
||||
'$group': {
|
||||
'_id': {
|
||||
'User': '$votes.u'
|
||||
},
|
||||
'claims': {
|
||||
'$sum': '$votes.claimable'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'claims': -1
|
||||
}
|
||||
}, {
|
||||
'$limit': 10
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'contents', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
element.claims=Math.floor(element.claims/100)
|
||||
console.log(element)
|
||||
})
|
||||
})
|
51
totalPendingPerUserOnVideosLessThan1Week.js
Normal file
51
totalPendingPerUserOnVideosLessThan1Week.js
Normal file
@ -0,0 +1,51 @@
|
||||
mongo = require("./mongoHelp.js")
|
||||
|
||||
agg = [
|
||||
{
|
||||
'$sort': {
|
||||
'ts': -1
|
||||
}
|
||||
},{
|
||||
'$unwind': {
|
||||
'path': '$votes',
|
||||
'includeArrayIndex': 'string',
|
||||
'preserveNullAndEmptyArrays': false
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'votes.u': 1
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'votes.claimed': null
|
||||
}
|
||||
}, {
|
||||
'$match': {
|
||||
'ts': {
|
||||
'$gt': Date.now()-604800000
|
||||
}
|
||||
}
|
||||
}, {
|
||||
'$group': {
|
||||
'_id': {
|
||||
'User': '$votes.u'
|
||||
},
|
||||
'claims': {
|
||||
'$sum': '$votes.claimable'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
'$sort': {
|
||||
'claims': -1
|
||||
}
|
||||
}, {
|
||||
'$limit': 10
|
||||
}
|
||||
]
|
||||
|
||||
mongo.aggregate('avalon5', 'contents', agg).then(res => {
|
||||
res.forEach(element => {
|
||||
element.claims=element.claims/100
|
||||
console.log(element)
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user