mirror of
https://github.com/tiennm99/MTTools.git
synced 2026-10-04 19:01:16 +00:00
crawl-prime
Crawl all prime numbers available on http://compoasso.free.fr/primelistweb/page/prime/liste_online_en.php
In 2025, I rewrote this project using Go. The earlier Python version is kept in history: browse it at its last commit.
Requirements
- Go 1.18 or higher
- Internet connection to access the prime list website
- Write permissions in the current directory (for
primes.txt)
Installation
-
Clone this repository:
git clone https://github.com/tiennm99/mttools.git cd mttools/crawl-prime -
Install Go (if not already installed):
# Download and install Go from https://golang.org/dl/ # Or use your package manager: # Ubuntu/Debian: sudo apt install golang # macOS: brew install go # Windows: Download from official website -
Install dependencies:
go mod tidy -
Run the script:
go run main.go
Usage
The program will automatically:
- Start crawling from prime number 1
- Process pages in batches of 600 primes each
- Write all found primes to
primes.txt - Display progress information during execution
- Stop when it reaches 1,000,000 primes or encounters an error
Output
primes.txt- Contains all crawled prime numbers, one per line
License
This project is for educational purposes. Please respect the terms of service of the prime list website.