tommyku / link-shortener-bot

Made this right before I knew there's something called @googlshortbot

Home Page:http://t.me/GiveMeShortLinkBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link shortener bot

Host your own link shortener that works with a bot. Just send the link to a bot and it'll take care of the rest for you. Demo: @GiveMeShortLinkBot

Getting Started

  1. Install Docker in your local machine or server
  2. Create a Telegram bot by talking to @BotFather
  3. Set up your own Firebase database
  4. Create and fill in the credentials to the env.yml file, see env.yml.example for the template
  5. run ./bin/build from the project root folder
  6. run ./bin/run from the project root folder
  7. Send a link to your bot from Telegram, you should be see reply like (you will need to set up a backend too.)
YOU: http://example.com
BOT: Wow, try http://randomhost.name/abcdefgh

Prerequisites

  1. Following the Docker installation guide.
  2. Create a Telegram bot with @BotFather
  3. Set up Firebase database from the official site.

Installing

After cloning the repo, you should create and fill in the credentials to the env.yml file, see env.yml.example for the template

To run locally using Docker:

$ ./bin/build
$ ./bin/run

To run without Docker (requires locally installed Ruby 2.3.1+):

$ bundle install
$ ruby link-shortener-bot.rb

Deployment

On the deployment machine:

$ ./bin/build
$ ./bin/run

Built With

License

This project is an open-sourced software licensed under the MIT license.

About

Made this right before I knew there's something called @googlshortbot

http://t.me/GiveMeShortLinkBot


Languages

Language:Ruby 96.4%Language:Shell 3.6%