{"id":13624378,"url":"https://github.com/Study-Together-Org/time_counter","last_synced_at":"2025-04-16T00:32:23.279Z","repository":{"id":48547057,"uuid":"322853020","full_name":"Study-Together-Org/time_counter","owner":"Study-Together-Org","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-26T06:34:31.000Z","size":519,"stargazers_count":12,"open_issues_count":15,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-01T21:59:51.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Study-Together-Org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-19T13:23:41.000Z","updated_at":"2024-04-12T20:19:24.000Z","dependencies_parsed_at":"2022-09-16T19:00:38.549Z","dependency_job_id":null,"html_url":"https://github.com/Study-Together-Org/time_counter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Study-Together-Org%2Ftime_counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Study-Together-Org%2Ftime_counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Study-Together-Org%2Ftime_counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Study-Together-Org%2Ftime_counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Study-Together-Org","download_url":"https://codeload.github.com/Study-Together-Org/time_counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223691578,"owners_count":17186847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:41.910Z","updated_at":"2024-11-08T13:30:20.866Z","avatar_url":"https://github.com/Study-Together-Org.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# [Study Together!](https://discord.me/studytogether) Codebase\n[![Discord Server](https://img.shields.io/discord/595999872222756885?color=purple\u0026label=Discord)](https://discord.me/studytogether)\n\n[![Pull Requests Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com)\n[![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)\n\n# How to Install\n(optional) Create a virtual environment\n`pip3 install -r requirements.txt`\nSet up MySQL database and Redis\n\n(optional) Get credentials from the dev team\n(optional) If you are using PyCharm, install [.env files support](https://plugins.jetbrains.com/plugin/9525--env-files-support) for env file autocompletion.\n\n# Quick Start\n`insert_data.py`\n`timezone_bot.py`\n`time_counter.py`\n\n# License\nAll rights reserved until I figure out which license is compatible with the used libraries.\n\n## Backgorund\nDiscord chatroom \n* 45k members in total (30 days 5k, over 10%)\n* Concurrently could reach ~5k+ members in diff channels\n* Rate of requests about 5/sec\n\n## Requirements\n\n* The rankings are based on the following\n  * all-time\n  * monthly (reset at UTC 5pm)\n  * weekly (reset at UTC 5pm)\n  * daily (reset at UTC 5pm)\n  * minutes (every single minute in the past 24h)\n* Auto restart when the discord bot dies\n\n* Show streak\n\n## Mechanism\n### basic\nA process listens to events from discord api when members join/leave study channels or request stats.\nThis process will insert logs into a SQL database (not any analytical data).\n\n### ranking\n# efficient way to maintain a linked list in sorted order\nAnother bot will use in memory sorted sets (also called skip lists) in-memory cache Redis to maintain the users' scores and rankings.\nEach ranking has a different sorted sets.\nnum of sorted set: 1 + 1 + 1 + 24 * 60\n\n### problems\npast 24h ranking not fully accurate\nevent based\n\nstreaks used: \n\ndaily Ranking last 24 hours (bad idea; your study time from yesterday influences your studytime and ranking today)\nperiodic calculating the ranking\nnot accurate, not real time, the wait time will keep increasing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStudy-Together-Org%2Ftime_counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStudy-Together-Org%2Ftime_counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStudy-Together-Org%2Ftime_counter/lists"}