{"id":16175643,"url":"https://github.com/johnpolacek/notyetnews","last_synced_at":"2025-03-19T00:31:24.629Z","repository":{"id":179578833,"uuid":"663559015","full_name":"johnpolacek/notyetnews","owner":"johnpolacek","description":"Satirical news site from the future. Generates its own articles every day with AI.","archived":false,"fork":false,"pushed_at":"2023-08-13T16:33:38.000Z","size":11468,"stargazers_count":17,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T07:53:55.474Z","etag":null,"topics":["dalle2","next","nextjs","openai"],"latest_commit_sha":null,"homepage":"https://notyetnews.vercel.app","language":"TypeScript","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/johnpolacek.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-07-07T15:19:06.000Z","updated_at":"2024-12-17T09:25:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"78edb359-034b-4562-921e-4ba224caa153","html_url":"https://github.com/johnpolacek/notyetnews","commit_stats":null,"previous_names":["johnpolacek/notyetnews"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpolacek%2Fnotyetnews","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpolacek%2Fnotyetnews/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpolacek%2Fnotyetnews/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpolacek%2Fnotyetnews/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnpolacek","download_url":"https://codeload.github.com/johnpolacek/notyetnews/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955697,"owners_count":20374373,"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":["dalle2","next","nextjs","openai"],"created_at":"2024-10-10T04:45:22.674Z","updated_at":"2025-03-19T00:31:24.623Z","avatar_url":"https://github.com/johnpolacek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NotYet.News\n\n\nNotYet.News is a satirical online publication with news stories generated by AI based on today's top news.\n\n## Build Journal\n\n### Current\n\nSetting up backend cron job with\n\n```\npnpm run cron\n```\n\nConnects to NYT API, need to connect to Open AI API\n\nRemember to use `pnpm` for installing packages.\n\n\n### TODO\n\n1. CRON Job\n2. Link to previous dates\n3. Link to articles\n4. Theme Switcher\n5. Footer\n\n\n### Initial Build\n\nStarted by talking to my brother about the project idea a little bit. He came up with the name, which I instantly liked.\n\nBootstrapped with Vercel's AI SDK.\n\nPlayed around with Chat GPT prompts to see what kind of results I could get - see https://chat.openai.com/share/87bd0bb4-c5dd-46bd-a805-a0c6b47fdbd1\n\nSigned up for the NYTimes API to get content for the prompts.\n\nSet up a serverless edge function to:\n\n1. Get articles from the NYTimes API\n2. For each article, send a prompt to gpt-4 `Generate a news article in the style of The Onion set 100 years into the future on this article from today's news. Factor in how drastically different the world would be in 100 years. This news article might not even be relevant: ${article}`\n3. Use an OpenAI Function to coerce the model to always return structured JSON as suggested by @jaredpalmer https://twitter.com/jaredpalmer/status/1673056725446844417\n4. Ask Chat GPT to also generate a prompt for an article image from DALLE \n5. After the image is created, transfer it from the temporary DALLE url to S3.\n6. When all the parody articles are generated, stringify the JSON and upload to S3 with the date as the filename.\n\nNext I created a Next.js page that would load the JSON from S3 and render a layout with a grid layout.\n\n\n### CRON Job\n\nI had the script generation running locally, where it could build a JSON file with all the articles and images. However, this process takes a long time, about 15 minutes or so. Vercel has a 10 second limit on their serverless functions. \n\nRewrote it to run locally as a node script. Looked into services that I could use to run the script as a cron job and settled on [Render](https://render.com/).\n\nSo now the cron script runs once a day to generate the content and upload the JSON as a file to S3. My frontend on Next.js loads the JSON from S3 and generates the front page and article pages.\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpolacek%2Fnotyetnews","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnpolacek%2Fnotyetnews","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpolacek%2Fnotyetnews/lists"}