Giter Club home page Giter Club logo

mhr's Introduction

mhr

๐Ÿ”— A simple URL shortener, controlled via a Telegram bot.

mhr = mihir, but shortened (*_*).

Setup

Create a Telegram Bot

You would first need to create a Telegram bot and get the bot's access token. Fortunately, it's pretty simple and easy: you can create one with @BotFather.

Make sure to take note of the token received! It should look like this: 3141592653:KAS_JFD04YEGFxbQV4FTPetQpZefUhr37HC.

Get your Telegram Chat ID

The chat_id identifies you on Telegram. You can get it by /starting a chat with @RawDataBot or some other ways. It can be a positive or negative number.

Setup the Server

  1. Clone this repo: git clone https://github.com/plibither8/mhr
  2. Install dependencies: npm install
  3. Create config.ts file from config.example.ts file: cp config.example.ts config.ts
  4. Edit the config.ts file with your values
  5. Start up the server and use the bot: npm start
  6. Party hard.

Usage

Open the chat with your bot and /start it.

Interact with your Telegram bot to create, read, update or delete the aliases. Following are the available commands:

Command Description
/help Show list of commands and help information.
/cancel Cancel the ongoing operation.
/urls Show list of shortened URLs along with their aliases.
/new Create a new alias for a URL.
/update Update the target URL for an existing alias.
/delete Delete an alias and redirection.

License

MIT

mhr's People

Contributors

plibither8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.