Skip to content

bruh-boys/anti-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check the real url from a url shortener (bit.ly)

Also you can use it as an API

example with deno

  const rawResponse = await fetch("https://anti-url-shortener.herokuapp.com/no-bitly", {
    method: "POST",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: `https://bit.ly/3nv15Ci`,
    }),
  });
  const content = await rawResponse.json();
  console.log(content);

example with curl

curl --location --request POST 'https://anti-url-shortener.herokuapp.com/no-bitly' \
--header 'Content-Type: application/json' \
--data-raw '{"url":"https://bit.ly/3nv15Ci"}'

example with python

import requests
import json

url = "https://anti-url-shortener.herokuapp.com/no-bitly"

payload = json.dumps({
  "url": "https://bit.ly/3nv15Ci"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

example with nodejs (axios)

var axios = require('axios');
var data = JSON.stringify({
  "url": "https://bit.ly/3nv15Ci"
});

var config = {
  method: 'post',
  url: 'https://anti-url-shortener.herokuapp.com/no-bitly',
  headers: { 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

About

its just a fork for contribute to the original repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published