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.
Release files for efb-mp-instantview-middleware 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| efb-mp-instantview-middleware-0.3.2.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| efb_mp_instantview_middleware-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / efb-mp-instantview-middleware-0.3.2.tar.gz
| Download URL | efb-mp-instantview-middleware-0.3.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bef7f157ccb849edb7535d3206e8eef88c688547db789439ffdf379793d78fdf
|
|
BLAKE2b-256 checksum How to use checksums |
3673d3976daa911fc31a6f404186a81da164f5307cbff584d91122f3c9ced63a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / efb_mp_instantview_middleware-0.3.2-py3-none-any.whl
| Download URL | efb_mp_instantview_middleware-0.3.2-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78b33885ee9cc30e53b1df1162ff82137c7d81805db3e1fbdb0b8df0fd3077c3
|
|
BLAKE2b-256 checksum How to use checksums |
83b5aa0c153f81e56ffe00099ee812186cb6ffb98b5e83f4d14f3f714edd1c31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|