mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
use different url shortener
This commit is contained in:
@@ -66,7 +66,7 @@ function shortenUrlEddp(url, success, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const SHORTEN_API_ORBIS = 'https://s.orbis.zone/a';
|
const SHORTEN_API_ORBIS = 'https://yourls.willb.info/api.php';
|
||||||
/**
|
/**
|
||||||
* Shorten a URL using Orbis's URL shortener API
|
* Shorten a URL using Orbis's URL shortener API
|
||||||
* @param {string} url The URL to shorten
|
* @param {string} url The URL to shorten
|
||||||
@@ -77,13 +77,15 @@ function orbisShorten(url, success, error) {
|
|||||||
if (window.navigator.onLine) {
|
if (window.navigator.onLine) {
|
||||||
try {
|
try {
|
||||||
request.post(SHORTEN_API_ORBIS)
|
request.post(SHORTEN_API_ORBIS)
|
||||||
.field('lsturl', url)
|
.field('action', 'shorturl')
|
||||||
|
.field('url', url)
|
||||||
.field('format', 'json')
|
.field('format', 'json')
|
||||||
.end(function(err, response) {
|
.end(function(err, response) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
error('Bad Request');
|
error('Bad Request');
|
||||||
} else {
|
} else {
|
||||||
success(response.body.short);
|
success(response.body.shorturl);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user