Code Monkey home page Code Monkey logo

efb-mp-instantview-middleware's Introduction

MPInstantViewMiddleware: A middleware for EFB

Notice

Middleware ID: catbaron.mp_instantview

The middleware ID was catbaron.mp_instanceview before version 0.3.0. Please take care of it, especially please remeber to update the configure file of EFB ($HOME/.ehforwarderbot/profiles/default/config.yaml).

MPInstantViewMiddleware is a middleware of EFB enable instant view for articles of official accounts.

How it works

This middleware generates a telegraph page for links sent by official accounts of wechat, which will enable the instant view. Thus you need an access_token (introduced below).

Dependense

  • Python >= 3.6
  • EFB >= 2.0.0
  • PyYaml
  • bs4
  • requests[sock]

Install and configuration

Install

pip install efb-mp-instantview-middleware

Enable

Register to EFB Following this document to edit the config file. The config file by default is $HOME/.ehforwarderbot/profiles/default. It should look like:

master_channel: foo.demo_master
slave_channels:
- foo.demo_slave
- bar.dummy
middlewares:
- foo.other_middlewares
- catbaron.mp_instantview

You only need to add the last line to your config file.

Configure the middleware

The config file by default is $HOME/.ehforwarderbot/profiles/default/catbaron.mp_instantview/config.yaml. Please create the config file if there is not one. You need to have a telegraph token and save it here. You can get a token following the document. The access_token is what you need.

This middleware need access to https://telegra.ph, add the proxy url to the configure file if necessary.

# Token of telegraph
telegraph_token: ACCESS_TOKEN

# Optional. Proxy url.
# Example:
#  proxy_url: socks5://<user>:<pass>@<host>:<port>
#  proxy_url: socks5://<host>:<port>
#  proxy_url: http://<host>:<port>
proxy_url: PROXY_URL

Restart EFB.

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.