{"id":22266121,"url":"https://github.com/stackxp/bad-apple-google-calendar","last_synced_at":"2026-04-29T08:09:09.169Z","repository":{"id":261496221,"uuid":"871685261","full_name":"stackxp/Bad-Apple-Google-Calendar","owner":"stackxp","description":"Play Bad Apple (or any other video) in Google Calendar","archived":false,"fork":false,"pushed_at":"2025-02-14T22:03:56.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T23:18:45.058Z","etag":null,"topics":["bad-apple","badapple","calendar","google","google-calendar","javascript","python","web"],"latest_commit_sha":null,"homepage":"","language":"Python","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/stackxp.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":"2024-10-12T16:48:01.000Z","updated_at":"2025-02-14T22:03:59.000Z","dependencies_parsed_at":"2024-11-06T21:46:13.273Z","dependency_job_id":"67f252f8-5b79-4d7d-b72f-1bb570aed6de","html_url":"https://github.com/stackxp/Bad-Apple-Google-Calendar","commit_stats":null,"previous_names":["stackxp/bad-apple-google-calendar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackxp%2FBad-Apple-Google-Calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackxp%2FBad-Apple-Google-Calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackxp%2FBad-Apple-Google-Calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackxp%2FBad-Apple-Google-Calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackxp","download_url":"https://codeload.github.com/stackxp/Bad-Apple-Google-Calendar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245476821,"owners_count":20621722,"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":["bad-apple","badapple","calendar","google","google-calendar","javascript","python","web"],"created_at":"2024-12-03T10:17:49.554Z","updated_at":"2026-04-29T08:09:04.126Z","avatar_url":"https://github.com/stackxp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bad-Apple-Google-Calendar\n\nPlay Bad Apple!! (or any other video file) in [Google Calendar](https://calendar.google.com/)\n\n![Bad Apple in the Google Calendar](docs/badapple.png)\n\n## Setup\n\n1. Download this repo anywhere on your computer\n2. Install additional pip packages by running `pip install -r requirements.txt`.\n3. Log into [Google Calendar](https://calendar.google.com/), select *year* in the top-right corner or press [Y] on your keyboard.\n4. right-click anywhere on the page and select *Save Page as...*\n5. Navigate to the path, where you downloaded this repo, and save the page as \"index.html\".\n6. A folder called \"index_files\" will be created along with the html-file. You can delete all of its contents, except:\n    - calendar_*[something]*.png\n    - Every .css file\n    - unnamed.png\n    - unnamed_*[something]*.png\n9. Download Bad Apple as an MP4 from [The Internet Archive](https://archive.org/details/TouhouBadApple).\n10. Insert the following code at the top of `index.html`:\n```html\n\u003cscript src=\"/badapple.js\"\u003e\u003c/script\u003e\n```\n9. Run `python3 main.py --video-path [path to bad apple]`.\n10. Open http://localhost:8000/ in a web browser.\n11. Open the browser's developer console and switch to the *Console* tab.\n12. Ignore all the warnings and enter `init()`. If you did everything right, all the days should light up blue.\n13. Now type `run()`. A preview window should open and the days in the calendar should start changing to the video.\n\n\u003e [!TIP]\n\u003e Run `python3 main.py` without arguments to see all command-line options available.\n\n## How it works\n\nThe main.py script starts a Flask and a WebSocket server. The Flask server serves the `index.html` file, `badapple.js` and the `index_files` folder.\nThe WebSocket server waits for a connection from the hosted webpage and then sends all the frames of the video as strings of ones and zeroes.\n\n`badapple.js` is responsible for the web browser side.\nWhen running `init()`, it organizes all of the calendar days into a list and sets their background color to blue.\nAnd when `run()` is executed, the script establishes a connection to the Python WebSocket-Server and updates every days' color to match the video's pixels.\n\n## TODO\n- Add audio playback to main.py\n- Compress the data sent to the browser\n- Make the days RGB/Grayscale (fancy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackxp%2Fbad-apple-google-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackxp%2Fbad-apple-google-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackxp%2Fbad-apple-google-calendar/lists"}