Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Shortening Url - OneUrl
- * Author : gienetic
- * Base : https://play.google.com/store/apps/details?id=de.lemke.oneurl
- * Note : Repost/Recode? Tag Author & Sumber lah
- */
- const axios = require("axios");
- const ua = "Gienetic/1.2.0 (Android 13; Pixel 7 Pro) Mobile";
- // da.gd
- async function daGD(url, customName) {
- const endpoint = `https://da.gd/shorten?url=${encodeURIComponent(url)}&shorturl=${encodeURIComponent(customName)}`;
- const res = await axios.get(endpoint, {
- headers: { "User-Agent": ua, "Accept-Encoding": "gzip" }
- });
- return res.data.trim();
- }
- // v.gd
- async function vGD(url, customName) {
- const endpoint = `https://v.gd/create.php?format=json&url=${encodeURIComponent(url)}&shorturl=${encodeURIComponent(customName)}&logstats=1`;
- const res = await axios.get(endpoint, {
- headers: { "User-Agent": ua, "Accept-Encoding": "gzip" }
- });
- return res.data.shorturl;
- }
- // tinu.be
- async function tinuBe(url, customName) {
- const payload = JSON.stringify([{ longUrl: url, urlCode: customName }]);
- const res = await axios.post("https://tinu.be/en", payload, {
- headers: {
- "User-Agent": ua,
- "Accept-Encoding": "gzip",
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- "next-action": "74b2f223fe2b6e65737e07eeabae72c67abf76b2"
- }
- });
- const code = res.data?.data?.urlCode || customName;
- return `https://tinu.be/${code}`;
- }
- // tinyurl.com (fix GET)
- async function tinyUrl(url, customName) {
- const endpoint = `https://tinyurl.com/api-create.php?url=${encodeURIComponent(url)}&alias=${encodeURIComponent(customName)}`;
- const res = await axios.get(endpoint, {
- headers: {
- "User-Agent": ua,
- "Accept-Encoding": "gzip"
- }
- });
- return res.data.trim();
- }
- // spoo.me normal
- async function spooMe(url, customName) {
- const endpoint = `https://spoo.me/?alias=${encodeURIComponent(customName)}&url=${encodeURIComponent(url)}`;
- const res = await axios.post(endpoint, null, {
- headers: {
- "User-Agent": ua,
- "Accept-Encoding": "gzip",
- "Content-Type": "application/x-www-form-urlencoded",
- "Accept": "application/json"
- }
- });
- return res.data.short_url;
- }
- // spoo.me emoji
- async function spooEmoji(url, emojis) {
- const endpoint = `https://spoo.me/emoji?emojies=${encodeURIComponent(emojis)}&url=${encodeURIComponent(url)}`;
- const res = await axios.post(endpoint, null, {
- headers: {
- "User-Agent": ua,
- "Accept-Encoding": "gzip",
- "Content-Type": "application/x-www-form-urlencoded",
- "Accept": "application/json"
- }
- });
- return res.data.short_url;
- }
- module.exports = { daGD, vGD, tinuBe, tinyUrl, spooMe, spooEmoji };
- //Example
- //await tinuBe("https://whatsapp.com/channel/0029Vb5EZCjIiRotHCI1213L", "IniSumberNya")
Advertisement
Add Comment
Please, Sign In to add comment