本文介绍了Google Apps脚本中的Url Shortener是否已更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直使用这个简单的功能在Google Apps脚本中创建缩短的链接。过去几个月一直在工作,但几天前停止工作。有没有变化?
I've been using this simple function to create shortened links in Google Apps Script. It's been working for the past few months but stopped working few days ago. Has there been a change?
function getShortenedUrl(url){
var longUrl = UrlShortener.newUrl()
.setLongUrl(url);
var shortUrl = UrlShortener.Url.insert(longUrl);
return shortUrl.getId();
}
推荐答案
是的。它有。我觉得它很难。
Yes. It has. I figured it out the hard way. Just make a small change for it to work
function getShortenedUrl(url){
var longUrl = UrlShortener.newUrl();
longUrl.setLongUrl(url);
var shortUrl = UrlShortener.Url.insert(longUrl);
return shortUrl.getId();
}
这篇关于Google Apps脚本中的Url Shortener是否已更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!