{"id":37114021,"url":"https://github.com/pattfy/useragent","last_synced_at":"2026-01-14T13:25:59.030Z","repository":{"id":49241471,"uuid":"214595135","full_name":"pattfy/useragent","owner":"pattfy","description":"A Go/Golang library that parses User-Agent.","archived":false,"fork":false,"pushed_at":"2025-03-26T00:57:16.000Z","size":45,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T20:51:09.626Z","etag":null,"topics":["golang","parser","user-agent"],"latest_commit_sha":null,"homepage":"","language":"Go","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/pattfy.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":"2019-10-12T06:54:13.000Z","updated_at":"2025-03-26T00:44:21.000Z","dependencies_parsed_at":"2025-03-26T00:45:41.741Z","dependency_job_id":null,"html_url":"https://github.com/pattfy/useragent","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pattfy/useragent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pattfy%2Fuseragent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pattfy%2Fuseragent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pattfy%2Fuseragent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pattfy%2Fuseragent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pattfy","download_url":"https://codeload.github.com/pattfy/useragent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pattfy%2Fuseragent/sbom","scorecard":{"id":722738,"data":{"date":"2025-08-11","repo":{"name":"github.com/pattfy/useragent","commit":"c21d0a10d081f6e3b1a755c2451f5cffa3190f0e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 2/8 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0061 / GHSA-r88r-gmrh-7j83","Warn: Project is vulnerable to: GO-2022-0956 / GHSA-6q6q-88xp-6f2r","Warn: Project is vulnerable to: GO-2020-0036 / GHSA-wxc4-f4m6-wwqv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T11:51:35.366Z","repository_id":49241471,"created_at":"2025-08-22T11:51:35.367Z","updated_at":"2025-08-22T11:51:35.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","parser","user-agent"],"created_at":"2026-01-14T13:25:58.372Z","updated_at":"2026-01-14T13:25:59.023Z","avatar_url":"https://github.com/pattfy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UserAgent \n[![CircleCI](https://circleci.com/gh/pattfy/useragent.svg?style=svg)](https://circleci.com/gh/pattfy/useragent)\nUserAgent is a Golang library that parses HTTP User-Agent.\n\n## Installation\n\n```\ngo get -u github.com/pattfy/useragent\n```\n\n## Struct and Interface\n\n```golang\n// UserAgent\ntype UserAgent struct {\n    UA       string  // User-Agent string\n    Bot      bot.Bot\n    Device   device.Device\n    Platform platform.Platform\n    Browser  browser.Browser\n}\n```\n\n### bot.Bot\n- `Name` (field)\nName of the bot\n- `IsBot()`\nIsBot check whether the User-Agent is identified as a bot.\n- `IsSearchEngine()`\nIsSearchEngine check whether the User-Agent is identified as a search engine.\n\n### browser.Browser\n- `ID()`\nreturn the ID of the browser(lower-case).\n- `Name()`\nreturn the name of the browser.\n- `FullVersion()`\nreturn the full version of the browser.\n- `Version()`\nreturn the major version of the browser.\n\n### device.Device\nNow such devices are availaable.\n- iPad\n- iPhone\n- Kindle\n- Surface\n\n#### Interface\n- `ID()`\nreturn the ID of the device(lower-case).\n- `Name()`\nreturn the name of the device.\n- `IsMobile()`\ncheck whether the User-Agent is a mobile device.\n- `IsTablet()`\ncheck whether the User-Agent is a tablet device.\n\n### platform.Platform\nNow such platforms are available.\n- Android\n- iOS\n- Linux\n- Mac\n- Windows\n- Windows Phone\n\n#### Interface\n- `ID()`\nreturn the ID of the platform(lower-case).\n- `Name()`\nreturn the name of the platform.\n- `Version()`\nreturn the version of the platform.\n\n## Usage\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pattfy/useragent\"\n)\n\nfunc main() {\n\tuserAgent := useragent.New(\"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1\")\n\n\tfmt.Printf(\"IsBot: %t\\n\", userAgent.IsBot())       // alias of bot.IsBot()\n\tfmt.Printf(\"IsMobile: %t\\n\", userAgent.IsMobile()) // alias of device.IsMobile()\n\tfmt.Printf(\"IsTablet: %t\\n\", userAgent.IsTablet()) // alias of device.IsTablet()\n\n\tfmt.Printf(\"FullVersion(): %q\\n\", userAgent.FullVersion()) // alias of browser.FullVersion()\n\tfmt.Printf(\"Version(): %q\\n\", userAgent.Version())         // alias of browser.Version()\n\tfmt.Printf(\"Name(): %q\\n\", userAgent.Name())               // alias of browser.Name()\n\n\t// bot\n\tbot := userAgent.Bot\n\tfmt.Printf(\"bot.IsBot(): %t\\n\", bot.IsBot())\n\tfmt.Printf(\"bot.IsSearchEngine(): %t\\n\", bot.IsBot())\n\n\t// device\n\tdevice := userAgent.Device\n\tfmt.Printf(\"device.ID(): %q\\n\", device.ID())     // id of device(lowser-case)\n\tfmt.Printf(\"device.Name(): %q\\n\", device.Name()) // name of device\n\n\t// browser\n\tbrowser := userAgent.Browser\n\tfmt.Printf(\"browser.ID(): %q\\n\", browser.ID())                   // id of browser(lower-case)\n\tfmt.Printf(\"browser.Name(): %q\\n\", browser.Name())               // name of browser\n\tfmt.Printf(\"browser.FullVersion(): %q\\n\", browser.FullVersion()) // full version of browser\n\tfmt.Printf(\"browser.Version(): %q\\n\", browser.Version())         // major version of browser\n\n\t// platform\n\tplatform := userAgent.Platform\n\tfmt.Printf(\"platform.ID(): %q\\n\", platform.ID())           // id of platform(lower-case)\n\tfmt.Printf(\"platform.Name(): %q\\n\", platform.Name())       // name of platform\n\tfmt.Printf(\"platform.Version(): %q\\n\", platform.Version()) // version of platform\n}\n```\n\n## License\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpattfy%2Fuseragent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpattfy%2Fuseragent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpattfy%2Fuseragent/lists"}