Git Product home page Git Product logo

novel's Introduction

书虫网 Build Status

书虫网是一个基于laravel5.2的小说采集/展示系统

环境要求

推荐使用homestead环境

  • PHP7
  • Laravel5.2
  • composer
  • node.js
  • mysql
  • beanstalkd
  • redis

安装使用说明

  1. 下载源码

    Linux下执行命令:

    git clone http://github.com/copyrenzhe/novel.git
    cd novel
    composer install
    npm install
  2. 配置项目

    执行下列命令:

    cp .env.example .env
    php artisan key:generate
    touch .env  //根据实际情况修改数据库配置
    php artisan migrate
    php artisan db:seed --class=CreateAdminSeeder
    gulp
  3. 运行系统 保证8000端口未被占用后 执行命令:

    php artisan serve

    然后在浏览器中输入localhost:8000 访问首页 进入localhost:8000/admin进入后台,初始用户名/密码:admin/admin

  4. 队列进程管理 推荐使用supervisor来管理自动更新与采集队列进程。 supervisord.conf的配置如下(可根据具体情况调整):

    [program:worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /var/www/novel/artisan queue:work --sleep=3 --tries=1 --memory=512 --daemon
    autostart=true
    autorestart=true
    user=root
    numprocs=2
    redirect_stderr=true
    stdout_logfile=/var/www/novel/storage/logs/queue-worker.log
    
    
    [program:beanstalkd]
    process_name=%(program_name)s_%(process_num)s
    command=beanstalkd -l 127.0.0.1 -p 11300
    autostart=true
    autorestart=true
    numprocs=1
    redirect_stderr=true
    stdout_logfile=/var/www/novel/storage/logs/beanstalkd.log
    
    [program:redis]
    process_name=%(program_name)s_%(process_num)s
    command=redis-server
    directory=/root/soft/redis/src
    autostart=true
    autorestart=true
    numprocs=1
    redirect_stderr=true
    stdout_logfile=/var/www/novel/storage/logs/redis.log

    配置完成后,后台即可爬取 笔趣阁看书中名著吧中的小说。所有爬取后的小说将会自动进行更新。

  5. 更新策略

    更新策略可以根据服务器负载能力进行调整,部分策略会发送邮件,需要在.env中配置smtp并修改管理员邮箱。

    • 每天10点和18点更新排名前30的热门小说
    • 每天凌晨三点更新所有小说
    • 每周六与起点的周排行进行对比
    • 每个月的28号与起点的月排行进行对比
    • 每十分钟监测系统是否运行正常
  6. 微信公众号配置

    .env中配置公众号的APPID、SECRET、TOKEN,并将公众账号的URL配置为 */wechat (*为网站url)

引用的框架与包

联系作者

Email: copyrenzhe [email protected]

novel's People

Contributors

copyrenzhe avatar bigbanana 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.