From fbe57d00db75888bcda472195da99cd958add616 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Sun, 5 Aug 2018 11:41:53 +1000 Subject: [PATCH] use different url shortener --- src/app/utils/ShortenUrl.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/utils/ShortenUrl.js b/src/app/utils/ShortenUrl.js index 8293711d..9e4fe8fd 100644 --- a/src/app/utils/ShortenUrl.js +++ b/src/app/utils/ShortenUrl.js @@ -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 * @param {string} url The URL to shorten @@ -77,13 +77,15 @@ function orbisShorten(url, success, error) { if (window.navigator.onLine) { try { request.post(SHORTEN_API_ORBIS) - .field('lsturl', url) + .field('action', 'shorturl') + .field('url', url) .field('format', 'json') .end(function(err, response) { if (err) { + console.error(err); error('Bad Request'); } else { - success(response.body.short); + success(response.body.shorturl); } }); } catch (e) {