{"id":20858766,"url":"https://github.com/thesephist/cornelia","last_synced_at":"2025-05-12T08:31:41.796Z","repository":{"id":52440378,"uuid":"256960576","full_name":"thesephist/cornelia","owner":"thesephist","description":"Guess that Taylor Swift line \u003c3","archived":false,"fork":false,"pushed_at":"2021-04-29T04:13:51.000Z","size":244,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-02T12:41:33.302Z","etag":null,"topics":["blocks-css","lyrics","music","taylor-swift","torus-dom"],"latest_commit_sha":null,"homepage":"https://1989.style","language":"JavaScript","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/thesephist.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}},"created_at":"2020-04-19T09:28:01.000Z","updated_at":"2022-11-13T11:29:05.000Z","dependencies_parsed_at":"2022-08-24T17:03:29.112Z","dependency_job_id":null,"html_url":"https://github.com/thesephist/cornelia","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fcornelia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fcornelia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fcornelia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesephist%2Fcornelia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesephist","download_url":"https://codeload.github.com/thesephist/cornelia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225130753,"owners_count":17425506,"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":["blocks-css","lyrics","music","taylor-swift","torus-dom"],"created_at":"2024-11-18T04:47:23.628Z","updated_at":"2024-11-18T04:47:24.366Z","avatar_url":"https://github.com/thesephist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cornelia 🚦\n\nGuess that Taylor Swift line \u003c3\n\n1989.style is made with [Torus](https://github.com/thesephist/torus) and [blocks.css](https://github.com/thesephist/blocks.css). You can try it live at [1989.style](https://1989.style).\n\n![1989.style](static/1989.png)\n\n## Design\n\nCornelia was a one-night project, so for sake of time I kept the software design pretty simple. There's a Go server which serves static files, in addition to a single dynamic JSON endpoint, `GET /line`, which returns a new random line of lyric along with which song it was pulled from.\n\nThe client-side single page app polls this endpoint for each question and renders it, and keeps track of the score per-device, completely locally, with synchronous `localStorage`. The quiz is a single Torus component.\n\nThe endpoint returns data of the form\n\n```js\n{\n    line: \"I fell in love with a careless man's careful daughter\",\n    title: \"Mine\",\n    choices: [\n        \"Should've Said No\",\n        \"Superman\",\n        \"You Are In Love\",\n    ],\n}\n```\n\ni.e. it picks a song at random from the dataset, picks a line at random from that song, and also presents three other unique songs as alternate choices for the question. The server does not verify or keep track of answers.\n\n### Source dataset\n\nThe dataset of lyrics is imported into the repository as a fixture and manually vetted for reasonable playability. It's stored as a flat directory of text files in `data/`. Each file is a song with the song title as the file name, and each line in the text file is a discrete lyric line that should be presented to the user in the quiz. This makes it trivial to add and revise the lyrics as needed.\n\nRather than use a structured database, for simplicity, Cornelia simply imports the dataset from the data directory on startup and commits it to a data structure in memory, from which it polls for new questions. Since there are only 120 songs, this design is just about as efficient as you can get.\n\n## License\n\nThis project is licensed under the included MIT License, except the lyrics under `data/`, whose copyright belong to the rights holders of the records.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesephist%2Fcornelia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesephist%2Fcornelia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesephist%2Fcornelia/lists"}