Google discontinued the goo.gl service in March 2019.
See this blog post for alternatives
Shortens url with goo.gl
From npm
$ npm i goorl
Required inputs
key Your google API key
url The URL you want to shorten
const goorl = require('goorl')
const options = {
key: 'your-google-api-key',
url: 'http://www.telemark.no/Planer/Regional-planstrategi/Offentlig-ettersyn-ny-regional-planstrategi'
}
goorl(options)
.then(url => console.log(url))
.catch(error => console.error(error))
const goorl = require('goorl')
const options = {
key: 'your-google-api-key',
url: 'http://www.telemark.no/Planer/Regional-planstrategi/Offentlig-ettersyn-ny-regional-planstrategi'
}
goorl(options, (error, url) => {
if (error) {
console.error(error)
} else {
console.log(url)
}
})