Giter Club home page Giter Club logo

better-url-bot's Introduction

better-url-bot

Deploy

A bot that will take a URL and return a better URL.

Usage

Feel free to try out @LFixBot on Telegram.

We also have a web API for you to try out.

curl "https://url.api.evo.moe/?url=https://x.com/virtual_kaf?s=20&format=json&preview=true"

NOTE that parameter url should be url encoded carefully to prevent losing parameters.

Parameter Description Default Required
url The URL to be fixed Yes
input The input format of the URL plain No
format The format of the response plain No
preview Whether to return a preview of the URL false No
brute Treat unknown url as short url and remove all parameters false No
depth The depth of the short url to be resolved (max 5) 1 No

Input format

Format Description
plain Plain text
base64 Base64 encoded

Output format

Format Description
plain Plain text
json JSON

Preview

The preview parameter is working for the following sites to fix url preview for following sites in IM such as telegram and discord:

  • Twitter

Deployment

wrangler kv:namespace create main
wrangler secret put ADMIN_TOKEN # Admin token for bot registration
wrangler secret put TGBOT_TOKEN # Telegram bot token
wrangler secret put WEBHOOKS_SECRET # Must be a random string, used to verify webhooks
wrangler secret put USERID_SALT # Must be a random string, salt to hash user id
wrangler secret put RECURSIVE_DEPTH # Must be a valid number, should be greater than 5
wrangler publish
# set up webhooks
curl your-deployment.worker.dev/bot-reg?token=ADMIN_TOKEN

TODO

  • Support for more sites

better-url-bot's People

Contributors

spartaen avatar

Stargazers

sck0537 avatar  avatar

Watchers

 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.