Scrape below blogs:
-
Install Docker Compose
https://docs.docker.com/compose/install/ -
Create DB schema
CREATE DATABASE IF NOT EXISTS `crawler`
DEFAULT CHARACTER SET = utf8mb4
COLLATE utf8mb4_unicode_ci;
$ sbt 'run-main app.Server -db.host localhost'
$ sbt docker:publishLocal
$ docker-compose build
$ docker-compose up
$ docker exec -it finagle-web-crawler_db_1 bash
Refs
- Create a JAR file
$ sbt assembly
- Run process
$ java -jar target/scala-2.12/finagle-web-crawler-assembly-1.0-SNAPSHOT.jar -db.host='localhost'
- Example
$ curl -X GET 'http://localhost:8080/feed/googleblog/developers'
- Example
$ curl -X GET 'http://localhost:8080/feed/googleblog/developers_jp'
- Example
$ curl -X GET 'http://localhost:8080/api/googleblog/developers?count=5&page=0'
- Example
$ curl -X GET 'http://localhost:8080/api/googleblog/developers_jp?count=5&page=0'
- Example
$ curl -X GET 'http://localhost:8080/api/developers/android?count=5&page=0'
- Example
$ curl -X GET 'http://localhost:8080/scrape/googleblog/developers'
- Example
$ curl -X GET 'http://localhost:8080/scrape/googleblog/developers_jp'
- Example
$ curl -X GET 'http://localhost:8080/scrape/googleblog/android'