Skip to main content

WeChat Middleware of EH Forwarder Bot to enable instant view for official accounts' articles

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

efb-mp-instantview-middleware-0.3.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file efb-mp-instantview-middleware-0.3.2.tar.gz.

File metadata

  • Download URL: efb-mp-instantview-middleware-0.3.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.9

File hashes

Hashes for efb-mp-instantview-middleware-0.3.2.tar.gz
Algorithm Hash digest
SHA256 bef7f157ccb849edb7535d3206e8eef88c688547db789439ffdf379793d78fdf
MD5 bb4429b5753d5ead538d363d9cbd8852
BLAKE2b-256 3673d3976daa911fc31a6f404186a81da164f5307cbff584d91122f3c9ced63a

See more details on using hashes here.

File details

Details for the file efb_mp_instantview_middleware-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: efb_mp_instantview_middleware-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.9

File hashes

Hashes for efb_mp_instantview_middleware-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 78b33885ee9cc30e53b1df1162ff82137c7d81805db3e1fbdb0b8df0fd3077c3
MD5 fb1927b097cc68df5957e0f9ca65ee67
BLAKE2b-256 83b5aa0c153f81e56ffe00099ee812186cb6ffb98b5e83f4d14f3f714edd1c31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page