{"id":21890110,"url":"https://github.com/ejfox/gpt-browser","last_synced_at":"2025-06-21T15:03:38.570Z","repository":{"id":223041473,"uuid":"666534029","full_name":"ejfox/gpt-browser","owner":"ejfox","description":"A Node.js script utilizing OpenAI's GPT to fetch, parse, and succinctly summarize web pages. ","archived":false,"fork":false,"pushed_at":"2024-05-22T04:57:01.000Z","size":182,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T06:37:23.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ejfox.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-14T19:13:24.000Z","updated_at":"2024-10-30T04:22:30.000Z","dependencies_parsed_at":"2024-02-17T21:31:35.999Z","dependency_job_id":"e63fc17e-6a4f-4b33-b740-17b74cbb78ab","html_url":"https://github.com/ejfox/gpt-browser","commit_stats":null,"previous_names":["ejfox/gpt-browser"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejfox%2Fgpt-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejfox%2Fgpt-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejfox%2Fgpt-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejfox%2Fgpt-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejfox","download_url":"https://codeload.github.com/ejfox/gpt-browser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235764324,"owners_count":19041522,"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":[],"created_at":"2024-11-28T11:28:49.428Z","updated_at":"2025-01-26T20:47:30.175Z","avatar_url":"https://github.com/ejfox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPT Browser\n\nA powerful Node.js package that fetches a webpage, breaks it into chunks, analyzes its content, and generates a summary using OpenAI's Chat API.\n\n\n\nhttps://github.com/ejfox/gpt-browser/assets/530073/e7a5a81e-40ca-44fb-8d2d-a1b0daa235b5\n\n\n\n## Features\n\n- Fetches and parses webpages using Puppeteer\n- Generates summaries using OpenAI's Chat API\n- Customizable summarization options (model, prompts, token limits)\n- Easy integration into your Node.js projects\n- Command-line interface using `npx`\n\n## Installation\n\nTo use GPT Browser in your project, install it from npm:\n\n```bash\nnpm install @ejfox/gpt-browser\n```\n\n## Usage\n\n### In a Node.js Project\n\nImport the `fetchAndSummarizeUrl` function from the package and use it in your code:\n\n```javascript\nconst { fetchAndSummarizeUrl } = require('@ejfox/gpt-browser');\n\nasync function main() {\n  const url = 'https://example.com';\n  const options = {\n    model: 'gpt-3.5-turbo',\n    summaryPrompt: 'Summarize the key points from the webpage:',\n  };\n\n  const summary = await fetchAndSummarizeUrl(url, options);\n  console.log(summary);\n}\n\nmain();\n```\n\n### Using `npx`\n\nYou can also use GPT Browser directly from the command line using `npx`:\n\n```bash\nnpx @ejfox/gpt-browser --url https://example.com\n```\n\n#### Customization Options\n\nYou can customize the summarization process by passing additional options:\n\n- `--model` or `-m`: OpenAI model to use for summarization (default: \"gpt-4-turbo-preview\")\n- `--chunkAmount` or `-c`: Desired chunk size for text splitting (default: 12952)\n- `--summaryPrompt` or `-sp`: Prompt for generating the summary (default: \"Please sort these facts from in order of importance, with the most important fact first\")\n- `--summaryMaxTokens` or `-smt`: Maximum number of tokens for the summary (default: 4096)\n- `--chunkPrompt` or `-cp`: Prompt for processing text chunks (default: WEBPAGE_UNDERSTANDER_PROMPT)\n\nExample with custom options:\n\n```bash\nnpx @ejfox/gpt-browser --url https://example.com --model gpt-3.5-turbo --chunkAmount 8000 --summaryPrompt \"Summarize the key points from the webpage:\"\n```\n\nYou can also store your prompts in local text files and echo them into the command:\n\n```bash\nnpx @ejfox/gpt-browser --url https://example.com --summaryPrompt \"$(cat summaryprompt1.txt)\" --chunkPrompt \"$(cat chunkprompt2.txt)\"\n```\n\n## Examples\n\n1. Summarize a Wikipedia article in your Node.js project:\n\n```javascript\nconst { fetchAndSummarizeUrl } = require('@ejfox/gpt-browser');\n\nasync function main() {\n  const url = 'https://en.wikipedia.org/wiki/OpenAI';\n  const summary = await fetchAndSummarizeUrl(url);\n  console.log(summary);\n}\n\nmain();\n```\n\n2. Summarize a news article with a custom prompt using `npx`:\n\n```bash\nnpx @ejfox/gpt-browser --url https://www.theatlantic.com/science/archive/2024/02/talking-whales-project-ceti --summaryPrompt \"Provide a brief overview of the main events covered in the article:\"\n```\n\n3. Summarize a blog post using a different OpenAI model in your project:\n\n```javascript\nconst { fetchAndSummarizeUrl } = require('@ejfox/gpt-browser');\n\nasync function main() {\n  const url = 'https://openai.com/blog/chatgpt';\n  const options = {\n    model: 'gpt-3.5-turbo',\n  };\n\n  const summary = await fetchAndSummarizeUrl(url, options);\n  console.log(summary);\n}\n\nmain();\n```\n\n## License\n\nThis project is open-source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejfox%2Fgpt-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejfox%2Fgpt-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejfox%2Fgpt-browser/lists"}