{"id":21585196,"url":"https://github.com/patricktrainer/summarize-gmail","last_synced_at":"2026-05-19T10:06:37.284Z","repository":{"id":202673500,"uuid":"707889426","full_name":"patricktrainer/summarize-gmail","owner":"patricktrainer","description":"Use google appscript to summarize your inbox.","archived":false,"fork":false,"pushed_at":"2023-10-20T23:03:11.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T09:13:46.947Z","etag":null,"topics":["appscript","chatgpt","gmail","openai"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patricktrainer.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}},"created_at":"2023-10-20T22:44:32.000Z","updated_at":"2024-08-09T12:57:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"07fa7c14-b857-4931-b1c8-a98f0d960828","html_url":"https://github.com/patricktrainer/summarize-gmail","commit_stats":null,"previous_names":["patricktrainer/summarize-gmail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patricktrainer/summarize-gmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fsummarize-gmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fsummarize-gmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fsummarize-gmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fsummarize-gmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patricktrainer","download_url":"https://codeload.github.com/patricktrainer/summarize-gmail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricktrainer%2Fsummarize-gmail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266706658,"owners_count":23971904,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["appscript","chatgpt","gmail","openai"],"created_at":"2024-11-24T15:09:24.506Z","updated_at":"2026-05-19T10:06:37.238Z","avatar_url":"https://github.com/patricktrainer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description:\n\nThis AppScript script is designed to summarize emails in your Gmail inbox. \n\nIt utilizes the OpenAI `GPT-3.5-turbo` model to generate summaries of the emails that match a certain filter criterion (i.e., starred and labeled as \"summarize\").\n\n### Example of a summarized email\n\nTurns this email \n\n![summarized email](./etc/sumGmail.png)\n\nInto this json response from OpenAI\n\n```json\n{\n  \"id\": \"chatcmpl-xxx-xxx-xxx-xxx\",\n  \"object\": \"chat.completion\",\n  \"created\": 1697841524,\n  \"model\": \"gpt-3.5-turbo-0613\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Summary: Patrick is sending a test email.\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 35,\n    \"completion_tokens\": 9,\n    \"total_tokens\": 44\n  }\n}\n```\n\nFrom here, you can send the response to your phone or other device for quick review.\n\n## Features\n\n**Post Message to OpenAI:** The script sends the content of the email to the OpenAI API for summarization.\n\n**Search Gmail:** It can search your Gmail inbox based on a given query.\n\n**Process Emails:** The script will look for emails that are starred and have the label `summarize`. Once the email is summarized, the star is removed.\n\n## Setup\n\n**API Key:** Ensure you have an active OpenAI API key. The script currently has a placeholder. Replace `OPENAI_API_KEY` with your own key.\n\n```javascript\nconst OPENAI_API_KEY = \"YOUR_OPENAI_API_KEY\";\n``````\n\n**Gmail Filters:** The script operates on emails that are both starred and labeled as \"summarize\". Set up a filter in your Gmail to star and label emails that you want summarized.\n\n## How to Use\n\n1. Run `main()` \n2. The script will fetch all emails that are starred and have the label \"summarize\".\n3. For each email that matches the criteria, it will send the content to OpenAI for summarization.\n4. Once processed, the star will be removed from the email.\n\n\n## Notes\n\nMake sure to handle your API key with care. Do not share or expose it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricktrainer%2Fsummarize-gmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatricktrainer%2Fsummarize-gmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricktrainer%2Fsummarize-gmail/lists"}