{"id":25392529,"url":"https://github.com/devnyxie/katsuragi","last_synced_at":"2025-04-10T01:20:23.538Z","repository":{"id":249330890,"uuid":"826960688","full_name":"devnyxie/katsuragi","owner":"devnyxie","description":"A Go toolkit offering utilities to efficiently extract favicons, links, descriptions, and titles, with support for LRU caching.","archived":false,"fork":false,"pushed_at":"2024-09-25T23:55:37.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T10:51:47.989Z","etag":null,"topics":["favicons","go","seo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devnyxie.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-07-10T18:17:35.000Z","updated_at":"2024-11-19T19:52:47.000Z","dependencies_parsed_at":"2025-02-15T16:40:37.320Z","dependency_job_id":"1df7a347-57cc-4147-b208-825a5c9871e6","html_url":"https://github.com/devnyxie/katsuragi","commit_stats":null,"previous_names":["devnyxie/katsuragi"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnyxie%2Fkatsuragi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnyxie%2Fkatsuragi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnyxie%2Fkatsuragi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnyxie%2Fkatsuragi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devnyxie","download_url":"https://codeload.github.com/devnyxie/katsuragi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138093,"owners_count":21053809,"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":["favicons","go","seo"],"created_at":"2025-02-15T16:40:28.662Z","updated_at":"2025-04-10T01:20:23.514Z","avatar_url":"https://github.com/devnyxie.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# katsuragi\n\n![Go Build](https://github.com/devnyxie/katsuragi/actions/workflows/go.yml/badge.svg)\n[![codecov](https://codecov.io/github/devnyxie/katsuragi/branch/main/graph/badge.svg?token=XFRMNJA858)](https://codecov.io/github/devnyxie/katsuragi)\n\nA Go toolkit for web content processing, analysis, and SEO optimization, offering utilities to efficiently extract favicons, links, descriptions and titles. \n\n\u003e [!NOTE]\n\u003e Each method is thoroughly tested and optimized for performance, but the package is still in development and may contain unseen bugs. Please don't hesitate to report any issues you encounter!\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Title](#title)\n  - [Description](#description)\n  - [Favicons](#favicons)\n  - [Links/Backlinks](#linksbacklinks)\n- [Local Development](#local-development)\n  - [Testing](#testing)\n  - [Code Coverage](#code-coverage)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# Features\n\n- LRU Caching\n- Timeout\n- User-Agent\n\n# Installation\n\n```bash\ngo get github.com/devnyxie/katsuragi\n```\n\n# Usage\n\n## Title\n\nThe GetTitle() function currently supports the following title meta tags:\n\n- `\u003ctitle\u003eTitle\u003c/title\u003e`\n- `\u003cmeta name=\"twitter:title\" content=\"Title\"\u003e`\n- `\u003cmeta property=\"og:title\" content=\"Title\"\u003e`\n\n```go\nimport (\n\t. \"github.com/devnyxie/katsuragi\"\n)\n\nfunc main() {\n  // Create a new fetcher with a timeout of 3 seconds and a cache capacity of 10\n  fetcher := NewFetcher(\n    \u0026FetcherProps{\n      Timeout:       3000, // 3 seconds\n      CacheCap: 10, // 10 Network Requests will be cached\n    },\n  )\n\n  defer fetcher.ClearCache()\n\n  // Get website's title\n  title, err := fetcher.GetTitle(\"https://www.example.com\")\n}\n```\n\n## Description\n\nThe GetDescription() function currently supports the following description meta tags:\n\n- `\u003cmeta name=\"description\" content=\"Description\"\u003e`\n- `\u003cmeta name=\"twitter:description\" content=\"Description\"\u003e`\n- `\u003cmeta property=\"og:description\" content=\"Description\"\u003e`\n\n```go\n...\n  // Get website's description\n  description, err := fetcher.GetDescription(\"https://www.example.com\")\n...\n```\n\n## Favicons\n\nThe GetFavicons() function currently supports the following favicon meta tags:\n\n- `\u003clink rel=\"icon\" href=\"favicon.ico\"\u003e`\n- `\u003clink rel=\"apple-touch-icon\" href=\"favicon.png\"\u003e`\n- `\u003cmeta property=\"og:image\" content=\"favicon.png\"\u003e`\n  \u003e Open Graph image (`og:image`) will be used only if both `og:image:width` and `og:image:height` are present and equal, forming a square image.\n\n```go\n...\n  // Get website's favicons\n  favicons, err := fetcher.GetFavicons(\"https://www.example.com\")\n  // [https://www.example.com/favicon.ico, https://www.example.com/favicon.png]\n...\n```\n\n## Links/Backlinks\n\nThe GetLinks() function searches for all `\u003ca\u003e` tags in the HTML document and returns a slice of links.\n\nOptions:\n\n- `Url` (required): The URL of the website to fetch.\n- `Category` (optional): The category of links to fetch. Possible values are `internal`, `external`, and `all`. Default is `all`.\n\n```go\n  // Get website's links\n  links, err := fetcher.GetLinks(GetLinksProps{\n    Url: \"https://www.example.com\",\n    Category: \"external\",\n  })\n  // [https://www.youtube.com/example, https://www.facebook.com/example]\n```\n\n# Local Development\n\n## Testing\n\n```bash\ngo test -v\n```\n\n## Code Coverage\n\n```bash\n# Generate coverage.out report, generate HTML report from coverage.out, and open the HTML report in the browser:\ngo test -coverprofile=coverage.out \u0026\u0026 go tool cover -html=coverage.out -o coverage.html \u0026\u0026 open coverage.html\n```\n\n# License\n\nThis project is licensed under the GNU General Public License (GPL). You can find the full text of the license [here](https://www.gnu.org/licenses/gpl-3.0.en.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnyxie%2Fkatsuragi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevnyxie%2Fkatsuragi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnyxie%2Fkatsuragi/lists"}