Crates.io | ptt-crawler |
lib.rs | ptt-crawler |
version | 0.1.0 |
source | src |
created_at | 2020-08-16 12:29:03.660756 |
updated_at | 2020-08-16 12:29:03.660756 |
description | A crawler for the web version of PTT, the largest online community in Taiwan |
homepage | |
repository | https://github.com/cwouyang/ptt-crawler/ |
max_upload_size | |
id | 277206 |
size | 865,274 |
A crawler for the web version of PTT, the largest online community in Taiwan.
Yet another PTT crawler but written in Rust. Can be used as binary directly or as crate.
Created by gh-md-toc
The binary name for ptt-crawler is ptc
.
Currently, no precompiled binary is available.
You need Rust 1.40 or higher and use cargo
to build ptt-crawler from the sources.
> cargo install ptt-crawler
> git clone https://github.com/cwouyang/ptt-crawler.git
> cd ptt-crawler
> cargo build --release
> ptc url https://www.ptt.cc/bbs/Gossiping/M.1597463395.A.478.html
Specify flags user agent -u
and proxy -p
used during crawling
> ptc -u "user/agent/string" -p "https://some.proxy" url https://www.ptt.cc/bbs/Gossiping/M.1597463395.A.478.html
# pass "random" to use randomly generated user agent
> ptc -u "random" https://www.ptt.cc/bbs/Gossiping/M.1597463395.A.478.html
# From page 100 (https://www.ptt.cc/bbs/Gossiping/index100.html) to 200 (https://www.ptt.cc/bbs/Gossiping/index200.html)
> ptc board Gossiping -r 100 200
# From page 1 to latest page
> ptc board Gossiping
Use -l
flag to list supported boards
> ptc board Gossiping --list
Add ptt-crawler
as dependence in Cargo.toml
file
[dependencies]
ptt-crawler = "0.1"
See document for usages.
> cargo test --all
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
Before submit pull request, make sure
ptt-web-crawler: PTT crawler in Python version
We use SemVer for versioning. For the versions available, see the tags on this repository.
Copyright (c) 2020 cwouyang.
This project is licensed under the terms of MIT License. See the LICENSE file for details.