{"id":16877660,"url":"https://github.com/willnorris/microformats","last_synced_at":"2025-09-20T22:32:32.395Z","repository":{"id":53956447,"uuid":"58242786","full_name":"willnorris/microformats","owner":"willnorris","description":"Go library for parsing microformats","archived":false,"fork":false,"pushed_at":"2025-05-31T04:03:21.000Z","size":223,"stargazers_count":71,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-13T02:53:57.694Z","etag":null,"topics":["microformats"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/willnorris.com/go/microformats","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/willnorris.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":"2016-05-07T01:00:13.000Z","updated_at":"2025-05-31T04:03:25.000Z","dependencies_parsed_at":"2024-03-01T07:36:17.891Z","dependency_job_id":null,"html_url":"https://github.com/willnorris/microformats","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/willnorris/microformats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnorris%2Fmicroformats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnorris%2Fmicroformats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnorris%2Fmicroformats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnorris%2Fmicroformats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willnorris","download_url":"https://codeload.github.com/willnorris/microformats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnorris%2Fmicroformats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276169426,"owners_count":25596952,"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-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["microformats"],"created_at":"2024-10-13T15:44:44.759Z","updated_at":"2025-09-20T22:32:32.125Z","avatar_url":"https://github.com/willnorris.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microformats\n\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue)](https://pkg.go.dev/willnorris.com/go/microformats)\n[![Test Status](https://github.com/willnorris/microformats/workflows/ci/badge.svg)](https://github.com/willnorris/microformats/actions?query=workflow%3Aci)\n[![Test Coverage](https://codecov.io/gh/willnorris/microformats/branch/main/graph/badge.svg)](https://codecov.io/gh/willnorris/microformats)\n\nmicroformats is a go library and tool for parsing [microformats][], supporting both classic v1 and [v2 syntax][].\nIt is based on Andy Leap's [original library][andyleap/microformats].\n\n[microformats]: https://microformats.io/\n[v2 syntax]: https://microformats.org/wiki/microformats-2\n[andyleap/microformats]: https://github.com/andyleap/microformats\n\n## Usage\n\nTo see this package in action, the simplest way is to install the command line\napp and use it to fetch and parse a webpage with microformats on it:\n\n```sh\n% go install willnorris.com/go/microformats/cmd/gomf@latest\n% gomf https://indieweb.org\n```\n\nTo use it in your own code, import the package:\n\n```go\nimport \"willnorris.com/go/microformats\"\n```\n\nIf you have the HTML contents of a page in an [io.Reader][], call [Parse][] like in this example:\n\n```go\ncontent := `\u003carticle class=\"h-entry\"\u003e\u003ch1 class=\"p-name\"\u003eHello\u003c/h1\u003e\u003c/article\u003e`\nr := strings.NewReader(content)\n\ndata := microformats.Parse(r, nil)\n\n// do something with data, or just print it out as JSON:\nenc := json.NewEncoder(os.Stdout)\nenc.SetIndent(\"\", \"  \")\nenc.Encode(data)\n```\n\nAlternately, if you have already parsed the page and have an [html.Node][], then call [ParseNode][].\nFor example, you might want to select a subset of the DOM, and parse only that for microformats.\nAn example of doing this with the [goquery package] can be seen in [cmd/gomf/main.go](cmd/gomf/main.go).\n\nTo see that in action using the gomf app installed above,\nyou can parse the microformats from indieweb.org that appear within the `#content` element:\n\n```sh\n% gomf https://indieweb.org \"#content\"\n\n{\n  \"items\": [\n    {\n      \"id\": \"content\",\n      \"type\": [\n        \"h-entry\"\n      ],\n      \"properties\": ...\n      \"children\": ...\n    }\n  ],\n  \"rels\": {},\n  \"rel-urls\": {}\n}\n```\n\n[Parse]: https://pkg.go.dev/willnorris.com/go/microformats#Parse\n[ParseNode]: https://pkg.go.dev/willnorris.com/go/microformats#ParseNode\n[io.Reader]: https://golang.org/pkg/io/#Reader\n[html.Node]: https://pkg.go.dev/golang.org/x/net/html#Node\n[goquery package]: https://github.com/PuerkitoBio/goquery\n\n## Additional helper packages\n\nUse the [ptd package] to perform [Post Type Discovery].\n\nUse the [rhc package] to find a [Representative h-card].\n\n[ptd package]: https://pkg.go.dev/willnorris.com/go/microformats/ptd\n[Post Type Discovery]: https://www.w3.org/TR/post-type-discovery/\n[rhc package]: https://pkg.go.dev/willnorris.com/go/microformats/rhc\n[Representative h-card]: http://microformats.org/wiki/representative-hcard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnorris%2Fmicroformats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillnorris%2Fmicroformats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnorris%2Fmicroformats/lists"}