{"id":16162054,"url":"https://github.com/peterdavehello/taipowertoslack","last_synced_at":"2026-05-06T01:32:57.413Z","repository":{"id":70808261,"uuid":"368935140","full_name":"PeterDaveHello/TaipowerToSlack","owner":"PeterDaveHello","description":"Fetch Taipower's \"Power Information of Today\", and send the information to your Slack channel","archived":false,"fork":false,"pushed_at":"2023-04-10T16:04:20.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T08:22:15.412Z","etag":null,"topics":["bash","demo","hacktoberfest","power","script","shellscript","slack","taipower","taiwan","webhook"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterDaveHello.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":"2021-05-19T16:32:57.000Z","updated_at":"2023-06-06T07:00:27.000Z","dependencies_parsed_at":"2024-10-19T19:17:48.315Z","dependency_job_id":"d603d200-e957-4226-bbcf-43afc6e9ad58","html_url":"https://github.com/PeterDaveHello/TaipowerToSlack","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/PeterDaveHello%2FTaipowerToSlack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterDaveHello%2FTaipowerToSlack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterDaveHello%2FTaipowerToSlack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterDaveHello%2FTaipowerToSlack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterDaveHello","download_url":"https://codeload.github.com/PeterDaveHello/TaipowerToSlack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589829,"owners_count":20963022,"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":["bash","demo","hacktoberfest","power","script","shellscript","slack","taipower","taiwan","webhook"],"created_at":"2024-10-10T02:28:56.489Z","updated_at":"2025-11-04T03:03:52.119Z","avatar_url":"https://github.com/PeterDaveHello.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TaipowerToSlack\n\nTaipowerToSlack is a tool that fetches the \"Power Information of Today\" from Taipower and sends the data to a designated Slack channel, allowing users to easily monitor Taiwan's power supply status.\n\nTaipower's \"Power Information of Today\" page:\n- English: \u003chttps://www.taipower.com.tw/en/page.aspx?mid=4484\u003e\n- Chinese: \u003chttps://www.taipower.com.tw/tc/page.aspx?mid=206\u0026cid=402\u0026cchk=8c59a5ca-9174-4d2e-93e4-0454b906018d\u003e\n\nPlease note that this is primarily a shell script demo, with code that might be less elegant and some hard-coded values.\n\n## Screenshots\n\nSlack Screenshot:\n\n![SlackScreenshot](SlackScreenshot.png)\n\nTerminal Screenshot:\n\n![TerminalScreenshot](TerminalScreenshot.png)\n\n## Setup and Usage\n\n### 1. Obtain your Slack Incoming Webhook URL\n\nRefer to [Slack's Documentation](https://api.slack.com/messaging/webhooks) for details on how to obtain an Incoming Webhook URL for your Slack channel.\n\n### 2. Clone this repository or download the script\n\nClone the repository:\n\n```sh\ngit clone https://github.com/PeterDaveHello/TaipowerToSlack\n```\n\nOr, download the run.sh script directly, and make the run.sh script executable:\n\n```sh\ncurl https://github.com/PeterDaveHello/TaipowerToSlack/raw/master/run.sh -o /path/to/TaipowerToSlack/run.sh\nchmod +x /path/to/TaipowerToSlack/run.sh\n```\n\n### 3. Configure and execute the script\n\nNavigate to the directory containing the `run.sh` script.\n\nSet the `SLACK_HOOK` variable in the shell script, or pass it when running the script:\n\n```sh\nSLACK_HOOK=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX ./run.sh\n```\n\nThe result should be displayed on your Slack channel as shown in the screenshot.\n\n### 4. Optional: Post to Slack only when the status changes\n\nTo enable this option, you can either set the `STATELESS` and `ONLY_POST_ON_STATUS_CHANGE` environment variables when running the script or modify them directly in the `run.sh` script:\n\n- Pass the variables when running the script:\n\n  ```sh\n  STATELESS=false ONLY_POST_ON_STATUS_CHANGE=true ./run.sh\n  ```\n\n- Or modify the `run.sh` script:\n\n  ```sh\n  STATELESS=\"false\"\n  ONLY_POST_ON_STATUS_CHANGE=\"true\"\n  ```\n\nWith either configuration, the script will use the file `~/.taipower.status` to store the status and only post a message to Slack when the status changes.\n\n## Dependencies\n\n- `jq`: for parsing JSON data\n- `curl`: for fetching JSON data from the Taipower API\n- `bash`: for running the shell script\n- `mktemp`: for creating temporary files\n- `bc`: for calculating percentages from data\n\nIf any of these tools are missing, you can usually install them using your system's package manager (e.g., `apt`, `yum`, or `pacman`).\n\n## License\n\nThis project is released under the [WTFPL v2 license](https://choosealicense.com/licenses/wtfpl/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdavehello%2Ftaipowertoslack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterdavehello%2Ftaipowertoslack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdavehello%2Ftaipowertoslack/lists"}