Giter Club home page Giter Club logo

aegis-crawler's Introduction

Aegis web crawler node

A simple method to just get text from the internet:

  1. choose a random url from the unvisited list and move it to the visited list
  2. download text; goto 1 if text is too big or is not valid utf8
  3. extract all links from the page
  4. for every link, add the link to the unvisited list if it is not currently in the visited or unvisited lists
  5. return {url, text, links}

Usage

POST to / to receive:

{
  "url": "the url that was scraped",
  "text": "the 'inner text' of the page",
  "links": ["a list of", "links on", "the page"]
}

Environment

  • MAX_LENGTH - max length (in bytes) on the page (defaults to 1048576; 1MB)
  • MAX_VISITED - max number of visited sites to remember (defaults to 10000)
  • MAX_UNVISITED - max number of unvisited sites to remember (defaults to 1000)
  • PORT - the port to listen on (defaults to 80)
  • DELAY - amount to delay responses by, in seconds (this is a horrible idea; defaults to 1)
  • USER_AGENT - user agent string to appear as (defaults to "AegisCrawler")
  • START_URLS - json encoded list of urls to start scraping on (defaults to '["https://old.reddit.com/r/news/"]')

TODO

  • method for only adding a maximum of N random new links from the page

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.