GithubHelp home page GithubHelp logo

leo9843 / wd_webcrawler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from niravshah/wd_webcrawler

0.0 0.0 0.0 203 KB

A Web Crawler using Java Fork Join and Spring Boot

Home Page: https://nns-wd-webcrawler.herokuapp.com/

Shell 17.50% Batchfile 12.41% Java 70.09%

wd_webcrawler's Introduction

Java Web Crawler

This web crawler has been implemented using the Java Fork Join pattern. A Hypermedia based REST API provides access to the crawler through the browser or any other REST client. The API has been implemented using Spring Boot.

The REST API receives Crawling requests and queues them to Redis. A Redis Consumer triggers the Fork Join pool to process new requests and constantly updates the status of ongoing requests.

Continuous Integration

The project has been integrated with Travis CI. Builds are triggered on every push to Github.

https://travis-ci.org/niravshah/wd_webcrawler

Continuous Delivery

Successful builds are deployed to Heroku. The HATEOAS API can be access via the below URL

https://nns-wd-webcrawler.herokuapp.com/

Prerequisities

Redis - The project can be checked out and run localy. It needs a default Redis Install. When running on Heroku, the VM has been provisioned with Redis already.

Installing

Heroku

Travis CI installs the app on Heroku. It can be accessed at below URL

https://nns-wd-webcrawler.herokuapp.com/

Local Checkout the project from Github and run the CrawlerApplication.java file. This will bootstrap the Spring Boot API.

You can access the local API at

http://localhost:8080

API

The API exposes three Hypermedia driven REST endpoints.

  1. Home
  2. Request
  3. Result

Home Resource

This acts as the landing page and provides the key hypermedia definitions for any client wanting to explore the API further

Example Urls:

https://nns-wd-webcrawler.herokuapp.com/
http://localhost:8080/

Request Resource

This resource accepts new crawling requests and queues them to Redis. A Redis Receiver then triggers the Fork Join pool to crawl the URL

This resource accepts two parameters:

  1. url - The URL that needs to be crawled
  2. md - Max Depth for crawling. A value of -1 crawls the whole domain.
https://nns-wd-webcrawler.herokuapp.com/request?url=http://wiprodigital.com&md=-1
http://localhost:8080/request?url=http://wiprodigital.com&md=-1

The endpoint will return a Request ID which can be used to track progress.

Result Resource

This resource gives the current status of the Request. If the crawling is complete, then it will display the sitemap. If the crawling is in progress, then it will give the a continuously updating snapshot of the number of links indexed.

This resource accepts one parameter.

  1. id - This is the request id
https://nns-wd-webcrawler.herokuapp.com/result?id=b4dee211-c03f-48da-ad6c-f0e107e99aab
http://localhost:8080/result?id=b4dee211-c03f-48da-ad6c-f0e107e99aab

Usage Example

Home Resource

Home

New Request Resource

Request

Result Resource

Request

Authors

  • Nirav Shah

wd_webcrawler's People

Contributors

niravshah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.