{"id":22398443,"url":"https://github.com/etrusci-org/raidtrain","last_synced_at":"2025-09-02T11:35:51.776Z","repository":{"id":191287117,"uuid":"683852741","full_name":"etrusci-org/raidtrain","owner":"etrusci-org","description":"Quickly create a time slot overview webpage for your Twitch raid train event and such activities.","archived":false,"fork":false,"pushed_at":"2023-08-29T12:47:03.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T05:24:22.674Z","etag":null,"topics":["event","php","raid","tool"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/etrusci-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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-27T22:41:01.000Z","updated_at":"2023-10-29T17:33:58.000Z","dependencies_parsed_at":"2025-02-01T05:32:30.541Z","dependency_job_id":null,"html_url":"https://github.com/etrusci-org/raidtrain","commit_stats":null,"previous_names":["etrusci-org/raidtrain"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etrusci-org%2Fraidtrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etrusci-org%2Fraidtrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etrusci-org%2Fraidtrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etrusci-org%2Fraidtrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etrusci-org","download_url":"https://codeload.github.com/etrusci-org/raidtrain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755595,"owners_count":20667027,"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":["event","php","raid","tool"],"created_at":"2024-12-05T07:10:38.795Z","updated_at":"2025-03-26T23:42:14.068Z","avatar_url":"https://github.com/etrusci-org.png","language":"PHP","readme":"# RaidTrain\n\nQuickly create a time slot overview webpage for your Twitch raid train event and such activities.\n\n---\n\n## Dependencies\n\n- [PHP](https://php.net) `\u003e= 8.1.20`\n- [Webserver](https://en.wikipedia.org/wiki/Web_server)\n\n---\n\n## Motivation\n\nThe purpose is to present a list of event times in the event timezone. Users will be relieved from the task of manually converting these times to their current timezones in order to comprehend when a particular time slot begins. This approach eliminates the need for users to actively select or be aware of their specific timezones.  \nAdditionally, it should be easy for administrators to create/update the time slots. Refer to the **Slots Data File** section below for more details on creating and updating these time slots.\n\nExample screenshot:  \n![screenshot](./screenshot.png)\n\n---\n\n## Slots Data File\n\nCreate a new text file. **Enter one time slot per line**, the format is:\n\n```text\nstart timestamp | end timestamp | dj name or empty if slot is free\n```\n\n```text\nYYYY-MM-DD HH:MM | YYYY-MM-DD HH:MM | Any Text or Empty\n```\n\nExample:\n\n```text\n2023-08-27 20:00 | 2023-08-27 21:00 | DJ Flash\n2023-08-27 22:00 | 2023-08-27 23:00 | DJ Bang\n2023-08-27 23:00 | 2023-08-28 00:00 | DJ Boom\n2023-08-28 00:00 | 2023-08-28 01:00 | DJ Mega\n2023-08-28 01:00 | 2023-08-28 02:00 | DJ Fire\n```\n\n**Enter times in the 24-clock format**. Remember that `00:00` means \"start of the day\" and therefore it'll be the next day - see:\n\n```text\n2023-08-27 23:00 | 2023-08-28 00:00 | DJ Boom\n```\n\n**Further...**\n\n- Lines that are empty or start with `#` are ignored so you can add notes.\n- You can leave the DJ name empty after the last separator (`|`) in case the slot is still free to take.\n- Lines that have not 3 parts - or in other words - are not 2 separators (`|`), are ignored.\n\n---\n\n## Basic Usage\n\nThere are two functional examples to read through and try out:\n- [usage-html-output.php](./example/usage-html-output.php)\n- [usage-json-output.php](./example/usage-json-output.php)\n\n\nHere's a rundown of the very basics:\n\n\n```php\n// Require/include the class file\nrequire './raidtrain.php';\n\n// Optionally aliasing the class so we don't have to refer to it as \\org\\etrusci\\raidtrain\\RaidTrain\nuse org\\etrusci\\raidtrain\\RaidTrain;\n\n// Init the class\n$App = new RaidTrain(\n    name: 'My Event', # name of your event\n    time_zone: 'America/New_York', # for valid timezone values see https://www.php.net/manual/en/timezones.php\n    slot_file: '/path/to/slot.txt', # see \"slots\" topic below\n);\n\n// Get the event data as array (default)\n$event = $App-\u003eget_event_data();\n\n// Or as JSON\n// $event = $App-\u003eget_event_data(as_json: true);\n\n// Do something with $event ...\n```\n\nThe event data will have the following structure:\n\n```json\n{\n    \"name\": \"Foo Event\",\n    \"time_zone\": \"Europe/Zurich\",\n    \"time_now\": \"2023-08-29 00:27:33\",\n    \"slot\": {\n        \"2023-08-29\": [\n            {\n                \"start\": \"2023-08-29 12:00\",\n                \"end\": \"2023-08-29 13:00\",\n                \"dj\": \"aaa\",\n                \"is_active\": false,\n                \"diff_start_human\": \"in 11h 32m\",\n                \"diff_start\": {\n                    \"d\": 0,\n                    \"h\": 11,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                },\n                \"diff_end_human\": \"in 12h 32m\",\n                \"diff_end\": {\n                    \"d\": 0,\n                    \"h\": 12,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                }\n            },\n            {\n                \"start\": \"2023-08-29 14:00\",\n                \"end\": \"2023-08-29 15:00\",\n                \"dj\": \"ccc\",\n                \"is_active\": false,\n                \"diff_start_human\": \"in 13h 32m\",\n                \"diff_start\": {\n                    \"d\": 0,\n                    \"h\": 13,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                },\n                \"diff_end_human\": \"in 14h 32m\",\n                \"diff_end\": {\n                    \"d\": 0,\n                    \"h\": 14,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                }\n            },\n            {\n                \"start\": \"2023-08-29 15:00\",\n                \"end\": \"2023-08-29 16:00\",\n                \"dj\": null,\n                \"is_active\": false,\n                \"diff_start_human\": \"in 14h 32m\",\n                \"diff_start\": {\n                    \"d\": 0,\n                    \"h\": 14,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                },\n                \"diff_end_human\": \"in 15h 32m\",\n                \"diff_end\": {\n                    \"d\": 0,\n                    \"h\": 15,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                }\n            }\n        ],\n        \"2023-08-30\": [\n            {\n                \"start\": \"2023-08-30 00:00\",\n                \"end\": \"2023-08-30 01:00\",\n                \"dj\": null,\n                \"is_active\": false,\n                \"diff_start_human\": \"in 23h 32m\",\n                \"diff_start\": {\n                    \"d\": 0,\n                    \"h\": 23,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                },\n                \"diff_end_human\": \"in 1d 0h 32m\",\n                \"diff_end\": {\n                    \"d\": 1,\n                    \"h\": 0,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                }\n            },\n            {\n                \"start\": \"2023-08-30 01:00\",\n                \"end\": \"2023-08-30 02:00\",\n                \"dj\": \"lll\",\n                \"is_active\": false,\n                \"diff_start_human\": \"in 1d 0h 32m\",\n                \"diff_start\": {\n                    \"d\": 1,\n                    \"h\": 0,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                },\n                \"diff_end_human\": \"in 1d 1h 32m\",\n                \"diff_end\": {\n                    \"d\": 1,\n                    \"h\": 1,\n                    \"m\": 32,\n                    \"s\": 26,\n                    \"is_past\": false\n                }\n            }\n        ]\n    }\n}\n```\n\n---\n\n## God Mode aka Admin\n\nThe **godmode.php** file is really just a dirty example. It let's you edit the slots data file on the web.  \nIf you want to use it, copy **.godmode-pw-example** and rename it to **.godmode-pw**. The example password that should already be in there, is `123`.\n\nCreate your own password hash with either [my genhash tool](https://etrusci.org/tool/genhash) or PHP:\n\n```php\n$myhash = password_hash(password: 'YOUR PASSWORD HERE', algo: PASSWORD_DEFAULT);\nprint($myhash);\n```\n\nYou should store **.godmode-pw** outside of the public webroot of your webserver.\n\nThe slots file must be readable+writable by the webserver process.\n\nAlso don't forget to adjust the `SLOT_FILE` and `PW_FILE` paths in **godmode.php**.\n\n---\n\n## License\n\nPublic Domain Worldwide\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetrusci-org%2Fraidtrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetrusci-org%2Fraidtrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetrusci-org%2Fraidtrain/lists"}