{"id":27015291,"url":"https://github.com/fregate/sgbot","last_synced_at":"2025-04-04T14:17:59.317Z","repository":{"id":24016561,"uuid":"100398585","full_name":"fregate/sgbot","owner":"fregate","description":"SteamGifts bot to enter for whitelisted games","archived":false,"fork":false,"pushed_at":"2025-02-12T18:05:28.000Z","size":142,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-12T18:44:57.481Z","etag":null,"topics":["golang","steam","steamgifts"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/fregate.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-15T16:46:19.000Z","updated_at":"2024-12-14T02:58:07.000Z","dependencies_parsed_at":"2024-12-01T04:27:05.493Z","dependency_job_id":"58470d30-8252-4d80-9fa3-a3602ee2a094","html_url":"https://github.com/fregate/sgbot","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/fregate%2Fsgbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fregate%2Fsgbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fregate%2Fsgbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fregate%2Fsgbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fregate","download_url":"https://codeload.github.com/fregate/sgbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190219,"owners_count":20898702,"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":["golang","steam","steamgifts"],"created_at":"2025-04-04T14:17:58.748Z","updated_at":"2025-04-04T14:17:59.311Z","avatar_url":"https://github.com/fregate.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sgbot\n\nSteamGifts bot to enter only for whitelisted games\n\nI wish I would win all my followed and wishlisted games ;) I don't want win all the games in SG and this bot will apply only for whilelisted games.\n\nThis is my first project in GO (and there no some goish features like channels and coroutines - just syntax)\n\nThis is python implementation which inspired me to do this\nhttps://github.com/theWaR13/SteamGiveawayManager\n\n## SGBot as a cloud function\nIf you have some cloud functions service (AWS Lambda, Yandex.Cloud, _etc_) you could try to install this bot as cloud function. At this point you can install it on Yandex.Cloud (as I did).\nFrankly, there is 3 cloud functions: bot which checks, email sender and script with db seeding.\n\n### Create DB for games, cookies and digest\n1. Create YandexDB (YDB) serverless database\n2. Copy DB 'location'\n\n### Create bot init function\n1. Run `yandex.botinit-func.deploy.sh` - it prepares all mandatory files\n2. Create function from zip archive, choose Go/1.17, set 128M, 60sec timeout, set `bot-init-func.RunInitBotDB` as entry point\n3. Create service account with editor privelegies for YDB\n4. Set `YDB_DATABASE` (this is location from YDB) environment variables\n5. Finish function creation\n6. Run function once (test). It has to create 3 tables into YDB: `games (id:uint64, name:string)`, `cookies (name:string, domain:string, path:string, value:string)` and `digest (message:UTF8)`\n\n### Create bot function\n1. Run `yandex.sgbot-func.deploy.sh` - it prepares all mandatory files\n2. Create function from zip archive, choose Go/1.17, set 128M, 60sec timeout, set `bot-func.RunSGBOTFunc` as entry point\n3. Create service account with editor privelegies for YDB\n4. Set `STEAM_PROFILE`, `STEAM_API_KEY` and `YDB_DATABASE` (this is location from YDB) environment variables\n5. Finish function creation\n6. Create trigger for schedule function invokation (hourly - but you can check as you wish)\n7. Create service account (or add to existing serverless.invoker role)\n8. It has to work!\n\n### Create digest function\n1. Run `yandex.digest-bot.deploy.sh` - it prepares all mandatory files\n2. Create function from zip archive, choose Go/1.17, set 128M, 5sec timeout, set `digest-func.SendDigest` as entry point\n3. Create service account with editor privelegies for YDB (or use existing)\n4. Set `MAILER_SMTP`, `MAILER_PORT`, `MAILER_AUTH_NAME`, `MAILER_AUTH_PWD`, `MAILER_SUBJECT`, `MAILER_RECIPIENT` environment variables for mailer creation and `YDB_DATABASE` for DB connection\n5. Finish function creation\n6. Create trigger for schedule function invokation (daily - but you can send as you wish)\n7. Create (select) service account with serverless.invoker role\n8. It has to work!\n\n# gogbot\nCheck GOG.com for giveaways (only for cloud functions)\n\n## Prerquisites\nRun bot-init (from sgbot *TODO: make this function and digest like shared function*) to create `cookie` database.\nCreate `digest` function too for receive emails.\n\n## Deploy and run gogbot func\n1. Run `yandex.gogbot-func.deploy.sh` - it prepares all mandatory files\n2. Create function from zip archive, choose Go/1.17+, set 128M, 60sec timeout, set `bot-func.RunGOGBOTFunc` as an entry point\n3. Create or use existed (created for `sgbot` for example) service account with editor privelegies for YDB\n4. Set `YDB_DATABASE` (this is location from YDB) environment variables\n5. Finish function creation\n6. Create trigger for schedule function invokation (daily - but you can check as often as you wish)\n7. Create service account (or add to existing serverless.invoker role)\n8. Add necessary cookie `gog-al` to database with domain like gog.com\n9. It has to work!\n\nBot writes something to log in 2 cases: first, if you won something, and second - if cookies are expires or invalid (401 - unauthorized). In other cases bot writes to log return code (to analyze if somethig will change).\n\n# External imports\n* https://github.com/PuerkitoBio/goquery - useful jquery-like selectors for HTML documents\n* https://github.com/takama/daemon - golang daemon\n* http://gopkg.in/gomail.v2 - mailer for spam\n* https://github.com/yandex-cloud/go-sdk - using as cloud function\n* https://github.com/ydb-platform/ydb-go-sdk - store data for cloud function\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffregate%2Fsgbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffregate%2Fsgbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffregate%2Fsgbot/lists"}