AhFei

AhFei

简洁的写作需要勇气

Self-recommended Telegram forwarding robot, convenient for organizing messages, and can also convert GIFs and splice images.

extract_forward_TGbot#

Cannot do without Telegram, because of some excellent active channels, updating open source, technology and other information, as well as meme channels like "沙雕墙". I used to collect messages, but...

Phones are naturally not suitable for organizing data, and it is not convenient to use Telegram on a computer to operate these collections.

So, this forwarding bot was born, dedicated to solving the organization and preprocessing of information. The basic function is to extract text and URLs from the messages sent to it, and be able to push them to a web notepad, making it faster and easier to organize.

Project address: AhFeil/extract_forward_tgbot: Store and forward messages sent to it, and be able to push them to a webpage for easy viewing and editing of information, with the ability to concatenate images and convert videos to GIF (github.com), the installation steps are described in the project description.

Basic usage of the forwarding bot:#

  1. Forward the message to it, or send a message directly.
  2. It will extract the text and internal links from it and save them. The internal links will be placed after the text in order.
  3. Send the command /push, it will push all the saved content to the web notepad and return the URL.
  4. Access the webpage on your computer to view and efficiently process.

I usually push all the accumulated content to the webpage on Saturdays and process it together with the accumulated content in RSS.

Experience the features#

Chat with the forwarding bot: t.me/extract_forward_bot

Animation demonstrating basic functions:

image

Push format (the separator is: save time + forwarded from which channel + URL to this message):

image.png

Current commands#

Basic functions:#

  1. /start: Verify if it can connect and if it is running.
  2. /push: Push all saved messages, the URL path is random, can be set using /set.
  3. /emsg: View the number of messages saved, the earliest message, and its save time.
  4. /dmsg: Delete the latest saved message and return the text, can be used to display the URL.

Extended functions:#

  1. /set: Set the URL path. Use the format /set mypath, only alphanumeric characters, 3 to 26 characters. Restore random path: /set random.
  2. /image: Combine the images in the queue.
  3. Video to GIF: Forward video messages from specified channels, or send videos to the bot yourself, and it will immediately return a GIF.

Specific usage of the image command:

"Simply put" --> Send an image to the forwarding bot, then send the command /image, and you will receive the returned image.

  1. How to add images to the queue
    • Forward messages from specified channels, the images in the messages will be added to the queue. The current specified channel is only "沙雕墙" t.me/extract_forward_bot.
    • Actively send images to the bot, they will also be saved in the image queue, only supports sending in the form of photos (phones default to sending as photos, the image form is actually a file).
  2. Rules for combining images
    • If there is only one image, it will return a picture with explanatory text, the text will be below the original image.
    • For two to four images, it will return a stitched image.
    • If there are five or more images, it will return a GIF. (Since GIFs are compressed into mp4, a zip file will also be sent)
    • Each time images are combined, the image queue will be cleared. Images with significantly different sizes will be stretched to the same size.
  3. Setting parameters
    • Only one parameter can be set at a time, and no combination will be performed, only the parameter will be set.
    • /image clear clears the images in the queue.
    • /image Some explanatory text sets the explanatory text.
    • /image time 3, /image time 1.5 sets the time interval for the generated GIF, in seconds.
    • /image array (1,2),(0,3) specifies the arrangement of the images. The numbers represent the order of the images in the queue, 1 is the earliest image sent to the bot, 0 represents an empty space. From 1 to 3, these three images will be placed in the order specified in the array, like this arrangement:
1 2
  3

There are still many issues with the current arrangement function, such as the matrix cannot be a single column or row, and 0 in some cases may cause the generated image to not be displayed completely. However, there should be no problem as long as 0 is not used.

The image dialog box is essentially a separate message for each image and cannot automatically determine whether it has ended. Therefore, by sending the command /image, the processing of the images accumulated in the queue can be completed.

Video to GIF demonstration:

video2gif

Image combination demonstration:

Stitched

2p2one

Converted to GIF

photos2gif

Adding explanatory text at the bottom of the image

add_text

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.