{"id":16747048,"url":"https://github.com/selfup/mega_power","last_synced_at":"2025-03-16T02:21:50.310Z","repository":{"id":71266564,"uuid":"149704643","full_name":"selfup/mega_power","owner":"selfup","description":"Pulls data from nyc gov api for mega millions and powerball. Basic CLI functionality","archived":false,"fork":false,"pushed_at":"2019-08-12T00:15:32.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T15:11:21.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-09-21T03:27:01.000Z","updated_at":"2019-08-12T00:15:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a0e0ec9-bf77-4cc7-ade6-2f288bab366f","html_url":"https://github.com/selfup/mega_power","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.030303030303030276","last_synced_commit":"e6cebd5bed6d26679a240b2cae29bb57277f5bc2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fmega_power","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fmega_power/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fmega_power/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fmega_power/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfup","download_url":"https://codeload.github.com/selfup/mega_power/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814964,"owners_count":20352076,"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-10-13T02:08:59.726Z","updated_at":"2025-03-16T02:21:49.888Z","avatar_url":"https://github.com/selfup.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MEGA POWER\n\n[Go](#go)\n\n[Bash](#bash)\n\n[Powershell](#powershell)\n\nFetches Powerball and Megamillions CSV data from the NewYork Gov Website.\n`https://data.ny.gov/api/views/:id/rows.csv?accessType=DOWNLOAD`\n\nIf data is already local, it just reads the existing files.\n\nIf you pass `new` to the `go` program it fetches new data.\n\nIf you pass `--update` or `-u` to the `powershell` program it fetches new data.\n\nIf you use `bash`, you will update manually. But it's quite simple :smile:\n\nExample of latest 8\n\n![new_mega_power_api](https://user-images.githubusercontent.com/9837366/51288802-6a0c0300-19c3-11e9-90c2-75734d4c4b39.PNG)\n\n## Fair Warning\n\nSince files are being written, I write two dotfiles in your `HOME/USERPROFILE` directory:\n\n- macOS/Linux: `$HOME`\n- Windows: `%USERPROFILE%`\n\nTo get rid of these harmless files: `rm ~/.mega_power.*` (bash/pwsh) :pray:\n\n## Be nice\n\nDon't slam the api. I would just call `new` (go) or `--update` (pwsh) every few days. Keep the data fresh, api calls low :boat:\n\n## Go\n\n```bash\ngo get github.com/selfup/mega_power \\\n  \u0026\u0026 go install github.com/selfup/mega_power\n```\n\nNow globally: `mega_power`\n\nTo update the files (new drawing) just pass `new`: `mega_power new` or `go run main.go new` :tada:\n\n## Development\n\n**Go**\n\nIf you want to work on this make sure you clone this into your `$GOPATH`\n\nOtherwise imports will break :boom:\n\n**Bash/Powershell**\n\nJust regular git flow, anywhere on the machine should be fine :smile:\n\n## Bash\n\n_cd into this repo_\n\n#### Fetch lottery data for Mega and Power\n\n_If you recently ran the `go` or `powershell` scripts you can skip this step unless you need to update for a more recent drawing_\n\n`./scripts/fetch.data.sh`\n\n#### Check last [n] drawings for Mega\n\n`./scripts/mega.last.sh 3` --\u003e returns last 3 drawings\n\n#### Check last [n] drawings for Power\n\n`./scripts/power.last.sh 3` --\u003e returns last 3 drawings\n\n#### Check by date of drawing\n\n```bash\n./scripts/date.mega.sh \"09/21/2018\"\n09/21/2018,01 02 11 52 64,09,04\n```\n\nThis is just a grep, so you can check by only month - day - year or any combo of MM/DD/YY\n\nExample:\n\n```bash\n./scripts/date.mega.sh \"21/2018\"\n08/21/2018,14 16 19 38 57,11,03\n09/21/2018,01 02 11 52 64,09,04\n```\n\n#### Check to see if numbers match\n\nUse a last scripts for your lottery of choice\n\n`numbers.mega.sh` takes two args:\n\n1. First arg is how many latest drawings\n1. Second arg is a string of the numbers you wanna grep\n\n```bash\n./scripts/numbers.mega.sh 3 \"01 02\"\n```\n\nReturns:\n\n```bash\n09/21/2018,01 02 11 52 64,09,04\n```\n\nGrep is nice and highlights matches in red :tada:\n\nTo narrow down the grep you can filter by date if your ticket is old or something.\n\nYou can even just check for one number on that draw date too:\n\n```bash\n./scripts/numbers.mega.sh 3 \"01 02\" | grep \"09/21/2018\"\n09/21/2018,01 02 11 52 64,09,04\n```\n\n## PowerShell\n\n_cd into this repo_\n\nBasic use:\n\n```powershell\n.\\powershell\\fetch.ps1\n```\n\nIf you get a permission error, try:\n\n```powershell\npowershell -ExecutionPolicy ByPass -File .\\powershell\\fetch.ps1\n```\n\n![image](https://user-images.githubusercontent.com/9837366/55524880-7283e980-5654-11e9-8229-6d6fbfe41dfd.png)\n\n#### Update Data Flag\n\nFull prompt when updating existing csv data:\n\n```powershell\npowershell -ExecutionPolicy ByPass -File .\\powershell\\fetch.ps1 --update\n```\n\n![image](https://user-images.githubusercontent.com/9837366/55524651-add1e880-5653-11e9-84a6-a474ffab4f17.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Fmega_power","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfup%2Fmega_power","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Fmega_power/lists"}