This script is a URL shortener that integrates various URL shortening services. It automatically fetches shortened URLs from multiple services and returns them.
- Shortens URLs using multiple services:
- Clone the repository:
git clone https://github.com/uixss/big-shot.git
- Navigate to the project directory:
cd bit-short
- Run the script with a URL as an argument:
python manager.py https://example.com
- Python 3.x
- Libraries:
requests
,beautifulsoup4
,requests_toolbelt
This script can also be integrated with a Telegram bot using the following Node.js code:
import { Telegraf } from 'telegraf';
import { exec } from 'child_process';
const bot = new Telegraf('<BOT_TOKEN>');
bot.command('short', (ctx) => {
const url = ctx.message.text.split(' ')[1];
if (!url || (!url.startsWith('http://') && !url.startsWith('https://'))) {
ctx.reply("Please provide a valid URL starting with http:// or https://");
return;
}
exec(`python manager.py ${url}`, (error, stdout, stderr) => {
if (error) {
ctx.reply(`Error executing the script: ${error.message}`);
return;
}
if (stderr) {
ctx.reply(`Script error: ${stderr}`);
return;
}
ctx.reply(`${stdout}`);
});
});
bot.launch();
This code allows users to send a URL to the Telegram bot, which will execute the Python script and return the shortened URL directly in the chat.
Feel free to submit pull requests or open issues to improve this script!