https://github.com/ehforwarderbot/efb-link_preview-middleware
https://github.com/ehforwarderbot/efb-link_preview-middleware
efb-middleware eh-forwarder-bot
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ehforwarderbot/efb-link_preview-middleware
- Owner: ehForwarderBot
- Created: 2020-12-31T07:56:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-31T07:56:42.000Z (about 5 years ago)
- Last Synced: 2025-01-12T05:12:36.821Z (about 1 year ago)
- Topics: efb-middleware, eh-forwarder-bot
- Language: Python
- Homepage:
- Size: 2.67 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LinkPreview: A middleware for EFB
## Notice
**Middleware ID**: `catbaron.link_preview`
**LinkPreview** is a middleware for EFB to generqate link preview for the first url contained by the message.


* For url refering to an image, the image should be sent as preview.
* Add `\np` at the begining of message to avoid link preview for current message.
You need to use **MessageBlocker** on top of [EFB](https://ehforwarderbot.readthedocs.io). Please check the document and install EFB first.
## Dependense
* Python >=3.6
* EFB >=2.0.0b15
* beautifulsoup4
## Install
* Install
```
pip install efb-link-preview-middleware
```
* Register to EFB
Following [this document](https://ehforwarderbot.readthedocs.io/en/latest/getting-started.html) to edit the config file. The config file by default is `~/.ehforwarderbot/profiles/default`. It should look like:
```
master_channel: foo.demo_master
slave_channels:
- foo.demo_slave
- bar.dummy
middlewares:
- foo.other_middlewares
- catbaron.link_preview
```
You only need to add the last line to your config file.
* Restart EFB.