Git Product home page Git Product logo

mosaiq's Introduction

MOSAIQ

Server

  • server.js serves whole news data as an object if requested GET /news.

  • crawler.js scrapes news of the day and save as <date>.json file and MySQL.

    • MySQL: 'news' table in 'MOSAIQ' database

    • colums of 'news' table

      Field Type Null Key Default Extra
      news_id INT(11) NO PRI NULL AUTO_INCREMENT
      date DATE NO NULL
      publisher VARCHAR(20) NO NULL
      headline TINYTEXT YES NULL
      body MEDIUMTEXT YES NULL
      img TEXT YES NULL
      link TINYTEXT NO NULL
      type VARCHAR(10) YES NULL
      isFirst VARCHAR(1) NO NULL
  • autoCrawler.js acts just as crawler.js except that it automatically scrapes articles every 5 a.m.

  • plainText.js removes tags from articles and count their words

  • clientModel.js shows how to request data to the server.

    • the server returns the array of objects.
    • data form
      [
      {
      date:<date>,
      publisher:<publisher>,
      type:<type of article>,
      headline:<article headline>,
      body:<article body>,
      img:<list of images>,
      length:<length of the body>,
      isFirst:<'Y' or 'N'>
      },
      ...
      ]
  • plainText.js reads rows with type from MySQL MOSAIQ database.
    Then, it makes file file.csv of the data for machine learning.

How to update Server

  1. ssh login to AmazonAWS
  2. git pull in ~/workspace/MOSAIQ
  3. npm run build in ~/workspace/MOSAIQ
  4. when the build is done,
    sudo cp -rf ~/workspace/MOSAIQ/build/* /var/www/html/
  5. now we have to stop server.js.
    forever list to see the pid of server.js run by background process.
  6. forever stop <pid of server.js> to stop the process.
  7. forever start server.js <MySQL password> to start the process.

mosaiq's People

Contributors

isutare412 avatar djmiblo avatar hestia49 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.