{"id":15645898,"url":"https://github.com/alexellis/href-counter","last_synced_at":"2025-04-30T11:10:59.623Z","repository":{"id":46752703,"uuid":"84668361","full_name":"alexellis/href-counter","owner":"alexellis","description":"Golang multi-stage build to count links within a page for SEO","archived":false,"fork":false,"pushed_at":"2023-10-11T23:24:25.000Z","size":75,"stargazers_count":52,"open_issues_count":1,"forks_count":41,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T15:36:19.102Z","etag":null,"topics":["docker","function","seo","serverless"],"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/alexellis.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":"2017-03-11T17:39:52.000Z","updated_at":"2023-09-01T10:14:57.000Z","dependencies_parsed_at":"2024-06-18T21:37:04.332Z","dependency_job_id":"207ead99-babe-47a0-a086-eafee1a206da","html_url":"https://github.com/alexellis/href-counter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexellis%2Fhref-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexellis%2Fhref-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexellis%2Fhref-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexellis%2Fhref-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexellis","download_url":"https://codeload.github.com/alexellis/href-counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249494043,"owners_count":21281659,"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":["docker","function","seo","serverless"],"created_at":"2024-10-03T12:10:31.273Z","updated_at":"2025-04-18T12:33:12.334Z","avatar_url":"https://github.com/alexellis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# href-counter\n\n\u003e A Golang example application which counts internal vs. external hrefs within a page to rate SEO.\n\nThe `golang.org/x/net/html` package is used to iterate through all the HTML tokens in the web-page. It provides a working example of parsing HTML piece-by-piece. \n\nThis can be built with the Dockerfile in the repository or through `go get`.\n\n### Learn more with my eBook - Everyday Go\n\n\"Everyday Go\" is the fast way to learn tools, techniques and patterns from real tools used in production.\n\nThis book is a compilation of practical examples, lessons and techniques for Go developers. The topics cover the software lifecycle from learning the fundamentals, to software testing, to distribution and monitoring.\n\nEveryday Go also covers multi-stage builds, Dockerfiles and GitHub Actions in more detail.\n\n[Buy on Gumroad](https://gumroad.com/l/everyday-golang)\n\n### References\n\nUsed in these two blog posts:\n\n* [Builder pattern vs. Multi-stage builds in Docker](http://blog.alexellis.io/mutli-stage-docker-builds/)\n* [Docker docs: Use multi-stage builds](https://docs.docker.com/build/building/multi-stage/#use-multi-stage-builds)\n\n### Running the example\n\n* With Go\n\n    ```sh\n    go build\n\n    $ url=http://blog.alexellis.io/ ./href-counter\n    {\"internal\":40,\"external\":2}\n\n    $ url=http://blog.alexellis.io/golang-json-api-client/  ./href-counter\n    {\"internal\":17,\"external\":15}\n    ```\n\n* Build with multi-stage build\n\n    ```sh\n    ./build.sh\n    ```\n\n* Run with Docker\n\n    ```sh\n    docker run -e url=https://www.alexellis.io/ -ti alexellis2/href-counter:0.1.0\n    {\"internal\":6,\"external\":11}\n    ```\n\n* Build with multiple Dockerfiles\n\n    ```sh\n    ./build-multi-dockerfiles.sh\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexellis%2Fhref-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexellis%2Fhref-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexellis%2Fhref-counter/lists"}