Skip to content

A python script to which access telegram messages including media on a specified channel and creates a WordPress post.

Notifications You must be signed in to change notification settings

Tom-Riddle09/telegram_wordpress_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Python Automation Script
for Telegram Messages and WordPress Post Creation

Prerequisites
• WordPress Xmlrpc: pip install python-wordpress-xmlrpc.
• Requests: pip install requests
• Telegram bot : pip install python-telegram-bot
• Logging : pip install logging
• ffmpeg (if windows system > winget install ffmpeg) python library > pip 
install python ffmpeg.

Credentials Used
✓ WordPress Application (for managing non-interactive connections)
✓ Application Name
✓ Application Password
✓ Telegram Bot Token
✓ WordPress Endpoint
✓ REST API Endpoint:
✓ WordPress Username
✓ WordPress Password
✓ Page Id for the Page 

How to run the script 
➢ Install the prerequisites.
➢ Run the script: python (script_name).py 
Keep the script running in background.

Functions used: Use case
• “save_log” : used to store log of the program to a log file.
• “ file_extn” : used to identify the telegram file extension and write it to 
the local directory, returns file path
• “upload_file”: used to upload file to the WordPress Media Library, 
returns file url.
• “create_wordpress_post”: used to create WordPress post with the 
uploaded file , returns post id.
• “create_vd_thmbnail”: usd to create video thumbnail for video files.

About

A python script to which access telegram messages including media on a specified channel and creates a WordPress post.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages