Skip to content

automatically fetches shortened URLs from multiple services

Notifications You must be signed in to change notification settings

uixss/BIG-SHORT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎫 Coding Services SEND DM 🎫

URL Shortener

This script is a URL shortener that integrates various URL shortening services. It automatically fetches shortened URLs from multiple services and returns them.

Features ✨

How to Use 📖

  1. Clone the repository:
    git clone https://github.com/uixss/big-shot.git
  2. Navigate to the project directory:
    cd bit-short
  3. Run the script with a URL as an argument:
    python manager.py https://example.com

Requirements 📋

  • Python 3.x
  • Libraries: requests, beautifulsoup4, requests_toolbelt

Telegram Bot Integration 🚀

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.

Contributing 🤝

Feel free to submit pull requests or open issues to improve this script!

About

automatically fetches shortened URLs from multiple services

Topics

Resources

Stars

Watchers

Forks