Giter Site home page Giter Site logo

news-crawler's Introduction

News-crawler (in development...)

A simple news crawler that fetching post's link and date

news crawler is a concept news crawler that crawls dantri, vnexpress, v.v... for posts data link. including api for fetching news's link by category order by date limit 10 posts and a websocket server for live update fetching.

Prequisites:

  • Nodejs
  • Mongodb

How to run the bot for crawling data and persists into mongoDB:

foo@bar:~$ git clone https://github.com/bettafish15/news-crawler.git
foo@bar:~$ cd news-crawler
foo@bar:~$ npm install --only=prod
foo@bar:~$ node spider/index.js

How to run the server to retrieve api end-point and live update feed:

foo@bar:~$ node bin\www

Mongodb will have following schema:

link: {
        type: String,
        unique: true,
        required: true,
        index: true
    },
    title: {
        type: String,
        unique: false,
        required: false
    },
    category: {
        type: String,
        unique: false,
        required: false
    },
    date: { type: Date, default: Date.now, index: true },

To add another paper you need to create a new js file inside the spiders folder and implement the crawling method. You need to include them to the index.js file inside the spiders folder too.

Improvement that need to be implement (There are many.....)

  • Fix the queue getting block everytime crawling for date halfway through the queue (problem with the Crawler library, not finding reason yet). Can make another service that find all the documents in mongodb that doesnt have a date yet and crawling that site again.
  • Adding new site to crawl data is too hard and static right now, in need for a more dynamic way
  • Code improvement for easy maintaining.

news-crawler's People

Contributors

bettafish15 avatar

Watchers

James Cloos avatar  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.