Compare commits
2 Commits
ec5514fa99
...
676c3d000f
Author | SHA1 | Date | |
---|---|---|---|
676c3d000f | |||
bdf995178f |
src/drstats
@ -17,7 +17,7 @@ def dump():
|
|||||||
printr(statistics_text)
|
printr(statistics_text)
|
||||||
for contribution in db.get_contributions():
|
for contribution in db.get_contributions():
|
||||||
statistics_text.append(
|
statistics_text.append(
|
||||||
f"===Statistics: User(ranter) {contribution['username']} is popularity rank {contribution['rank']} and made {contribution['contributions']} contributions to devRant(developer community) what means {contribution['username']} owns {contribution['ownership']} percent of contributions on devRant(developer community). The avarage post length of {contribution['username']} is {contribution['post_length_average']} and total post length is {contribution['post_length_total']}. {contribution['username']} owns {contribution['ownership_content']} percent of content on devRant(developer community)."
|
f"===Statistics: User(ranter) {contribution['username']} is appreciation ranked {contribution['rank_by_appreciation_based_on_upvotes_per_message']} and made {contribution['contributions']} contributions to devRant(developer community) what means {contribution['username']} owns {contribution['ownership']} percent of contributions on devRant(developer community). The avarage post length of {contribution['username']} is {contribution['post_length_average']} and total post length is {contribution['post_length_total']}. {contribution['username']} owns {contribution['ownership_content']} percent of content on devRant(developer community)."
|
||||||
)
|
)
|
||||||
printr(statistics_text[-1])
|
printr(statistics_text[-1])
|
||||||
print("\n".join(statistics_text))
|
print("\n".join(statistics_text))
|
||||||
|
@ -206,7 +206,7 @@ def get_db():
|
|||||||
"CREATE VIEW posts_of_user AS SELECT user_username as username, GROUP_CONCAT(body) as text FROM comments"
|
"CREATE VIEW posts_of_user AS SELECT user_username as username, GROUP_CONCAT(body) as text FROM comments"
|
||||||
)
|
)
|
||||||
db.query("DROP VIEW IF EXISTS contributions_extended_ranked")
|
db.query("DROP VIEW IF EXISTS contributions_extended_ranked")
|
||||||
db.query("CREATE VIEW contributions_extended_ranked AS SELECT ROW_NUMBER() OVER (ORDER BY upvotes_per_post_on_average DESC) as rank, * FROM contributions_extended ORDER BY upvotes_per_post_on_average DESC")
|
db.query("CREATE VIEW contributions_extended_ranked AS SELECT ROW_NUMBER() OVER (ORDER BY upvotes_per_post_on_average DESC) as rank_by_appreciation_based_on_upvotes_per_message, * FROM contributions_extended ORDER BY upvotes_per_post_on_average DESC")
|
||||||
db.query("CREATE VIEW IF NOT EXISTS views AS SELECT sql, name FROM sqlite_schema WHERE type='view' AND name != 'views';")
|
db.query("CREATE VIEW IF NOT EXISTS views AS SELECT sql, name FROM sqlite_schema WHERE type='view' AND name != 'views';")
|
||||||
|
|
||||||
return db
|
return db
|
||||||
|
Loading…
Reference in New Issue
Block a user