Coder Social home page Coder Social logo

moviebox's Introduction

Telegram Bot Dytt

telegram bot 推送电影天堂最新电影

效果如下入所示

使用方法

部署服务端

一、Docker (推荐使用)

  1. 构建镜像

    切换到dockerfile文件所在目录

    sudo docker build . -t movie_bot
    
  2. 启动镜像

    sudo docker run -d -p 8000:8000 movie_bot
  3. 发送 GET 请求 imgType 自己填写, 得到 json 数据

    http://{YOUR_SCRAPYRT_IP}:8000/crawl.json?start_requests=true&spider_name=movie

    scrapyrt

二、本机环境

1. 需要的环境
  1. python 3+
  2. scrapy
  3. scrapyrt
2. 步骤
  1. 首先准备 scrapy 爬虫项目

  2. 下载并安装 scrapyrt, 并用当前目录的 resources.py 替换项目中的 resources.py

  3. 使用命令 scrapy crawl movie 确认爬虫可以正常使用后, 执行 scrapyrt -p 8000 开始在 8000 端口监听 web 请求

  4. 发送 GET 请求 imgType 自己填写, 得到 json 数据

    http://{YOUR_SCRAPYRT_IP}:8000/crawl.json?start_requests=true&spider_name=movie
    

部署客户端

GoogleScript 目录中的代码拷贝到 google script 平台上, 具体步骤推荐该视频: Telegram bot 机器人编程系列, 并且替换其中的 YOUR_CHAT_ID, YOUR_BOT_TOKEN 和 上一步搭建 scrapyrt 的服务端 ip地址 YOUR_SCRAPYRT_IP, 然后运行 app.gs中的 sendMovie 方法, 即可看到效果。

备注

:0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name opentype'. Please install it from https://pypi.python.org/pypi/service_identity and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.

pip install service_identity

moviebox's People

Contributors

kba977 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.