{"id":17355408,"url":"https://github.com/raj3k/webscraper","last_synced_at":"2025-03-27T14:18:03.170Z","repository":{"id":199346652,"uuid":"702662385","full_name":"raj3k/webscraper","owner":"raj3k","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-23T20:11:50.000Z","size":369,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:29:56.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raj3k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-09T18:44:39.000Z","updated_at":"2023-10-10T13:45:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"da19b464-3ca2-4823-8df9-99a1d34b6e41","html_url":"https://github.com/raj3k/webscraper","commit_stats":null,"previous_names":["raj3k/webscraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj3k%2Fwebscraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj3k%2Fwebscraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj3k%2Fwebscraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raj3k%2Fwebscraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raj3k","download_url":"https://codeload.github.com/raj3k/webscraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858884,"owners_count":20684062,"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":[],"created_at":"2024-10-15T17:43:14.453Z","updated_at":"2025-03-27T14:18:03.143Z","avatar_url":"https://github.com/raj3k.png","language":"Go","readme":"# Recruitment project - Webscraper\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n    - [Usage](#usage)\n    - [Test](#test)\n- [Outputs](#outputs)\n- [References](#references)\n\n\n## Introduction\n\nThis tool is a website word frequency analyzer built using Go (Golang). It leverages goroutines, channels, and the standard Go library to combine text from multiple websites and generate a list of the most frequently appearing words. I followed tasks listed in [Projects](https://github.com/users/raj3k/projects/5) while building this tool. Two methods were used to scrape website contents:\n- https://github.com/raj3k/webscraper/blob/main/internal/parse/parse.go - method from soup package\n- https://github.com/raj3k/webscraper/blob/main/internal/tokenizer/tokenizer.go - used html/tokenizer accordaning to requirements\n\n## Features\n\n- [Fetch text content from multiple websites.](https://github.com/raj3k/webscraper/blob/main/main.go#L28C10-L28C10)\n- [Generate word frequency statistics.](https://github.com/raj3k/webscraper/blob/main/main.go#L39)\n- [Concurrent using goroutines and channels.](https://github.com/raj3k/webscraper/blob/main/webscraper.go#L52)\n- [Basic cache mechanism.](https://github.com/raj3k/webscraper/blob/main/webscraper.go#L123)\n- [Limit the number of concurrently running goroutines.](https://github.com/raj3k/webscraper/blob/main/webscraper.go#L105)\n- [Running application in Docker container](https://github.com/raj3k/webscraper/blob/main/Dockerfile)\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed on your system:\n\n- [Go 1.21 (Golang)](https://golang.org/doc/install)\n- Optional: [Docker](https://www.docker.com/)\n## Getting Started\n\n### Usage\n\n1. Clone this repository \u0026 change into the project directory:\n   ```shell\n   git clone https://github.com/raj3k/webscraper.git\n   cd webscraper\n   ```\n    a. Run project using **Makefile**:\n    ```shell\n   make run\n    ```\n    b. Run project using **Docker**:\n    ```shell\n   docker build -t webscraper .\n   docker build -e URLS=\"https://example.com/,https://toscrape.com/\" webscraper\n    ```\n   or\n    ```shell\n   docker build -t webscraper .\n   docker build webscraper\n    ```\n\n### Test\n1. Clone this repository \u0026 change into the project directory:\n   ```shell\n   git clone https://github.com/raj3k/webscraper.git\n   cd webscraper\n   ```\n2. Test project using **Makefile**:\n    ```shell\n   make test\n    ```\n\n## Outputs\n### Using Makefile and limiting to 2 concurrent goroutines\n![2.png](2.png)\n### Using Makefile and limiting to 4 concurrent goroutines\n![4.png](4.png)\n\n## References\n- https://github.com/anaskhan96/soup/tree/master\n- https://github.com/lotusirous/go-concurrency-patterns/blob/main/10-google2.0/main.go\n- https://github.com/luk4z7/go-concurrency-guide\n- https://medium.com/@deckarep/gos-extended-concurrency-semaphores-part-1-5eeabfa351ce\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraj3k%2Fwebscraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraj3k%2Fwebscraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraj3k%2Fwebscraper/lists"}