use different url shortener

This commit is contained in:
willyb321
2018-08-05 11:41:53 +10:00
parent dc4fdf215c
commit fbe57d00db

View File

@@ -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) {