{"id":20563306,"url":"https://github.com/siddhant-vij/html-link-parser","last_synced_at":"2025-06-23T08:40:07.890Z","repository":{"id":245070125,"uuid":"784067377","full_name":"siddhant-vij/HTML-Link-Parser","owner":"siddhant-vij","description":"Go-based package to parse links (\u003ca\u003e tags) from an HTML file.","archived":false,"fork":false,"pushed_at":"2024-04-09T07:40:53.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T19:36:47.643Z","etag":null,"topics":["dfs","gophercises","io-readers","parsing-html","recursion"],"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/siddhant-vij.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-04-09T05:57:02.000Z","updated_at":"2024-04-09T05:59:31.000Z","dependencies_parsed_at":"2024-06-19T14:53:16.861Z","dependency_job_id":"e28dd874-fdc7-4e37-b08b-e2edcb52a603","html_url":"https://github.com/siddhant-vij/HTML-Link-Parser","commit_stats":null,"previous_names":["siddhant-vij/html-link-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhant-vij%2FHTML-Link-Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhant-vij%2FHTML-Link-Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhant-vij%2FHTML-Link-Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhant-vij%2FHTML-Link-Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddhant-vij","download_url":"https://codeload.github.com/siddhant-vij/HTML-Link-Parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242171575,"owners_count":20083578,"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":["dfs","gophercises","io-readers","parsing-html","recursion"],"created_at":"2024-11-16T04:17:33.548Z","updated_at":"2025-03-06T08:19:42.371Z","avatar_url":"https://github.com/siddhant-vij.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML Link Parser\n\n[Gophercises](https://gophercises.com/) Exercise Details:\n\nIn this exercise your goal is create a package that makes it easy to parse an HTML file and extract all of the links (`\u003ca href=\"\"\u003e...\u003c/a\u003e` tags). For each extracted link you should return a data structure that includes the `href`.\n\nLinks will be nested in different HTML elements, and it is very possible that you will have to deal with HTML similar to code below.\n\n```html\n\u003ca href=\"/dog\"\u003e\n  \u003cspan\u003eSomething in a span\u003c/span\u003e\n  Text not in a span\n  \u003cb\u003eBold text!\u003c/b\u003e\n\u003c/a\u003e\n```\n\nIn situations like these we want to get output that looks roughly like:\n\n```go\nLink{\n  Href: \"/dog\",\n}\n```\n\nOnce you have a working program, try to write some tests for it to practice using the testing package in go.\n\n\u003cbr\u003e\n\n## Technical Notes\n\n- Use the `x/net/html` package. Package html implements an HTML5-compliant tokenizer and parser.\n- Ignore nested links. Eg with following HTML:\n    ```html\n    \u003ca href=\"#\"\u003e\n    Something here \u003ca href=\"/dog\"\u003enested dog link\u003c/a\u003e\n    \u003c/a\u003e\n    ```\n    It is okay if your code returns only the outside link - for the purposes of this exercise.\n    \u003cbr\u003e\n    *Include the nested links as well in the output.*\n- Test the code with example files included in the project repository. *Improve your tests and edge-case coverage.* Add Examples and Documentation for the code. Run the following in this order, using go tooling:\n  - tests\n    - go test\n  - coverage\n    - go test -cover\n    - go test -coverprofile coverage.out\n  - coverage shown in web browser\n    - go tool cover -html=coverage.out\n  - examples shown in documentation in a web browser\n    - godoc -http=:8080","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhant-vij%2Fhtml-link-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddhant-vij%2Fhtml-link-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhant-vij%2Fhtml-link-parser/lists"}