title: Extract 301 Redirect URL from Google Sheets - Script Editor
body: <p>I've been looking a way to improve an awesome Google Sheets Script I found on StackOverflow:</p>
  <pre><code>function getStatusCode(url){
     var options = {
       'muteHttpExceptions': true,
       'followRedirects': false
     };
     var url_trimmed = url.trim();
     var response = UrlFetchApp.fetch(url_trimmed, options);
     return response.getResponseCode();
  }
  </code></pre>
  <p>It ends up giving you the status (200, 301, 500, 404, etc), However I want to extract the URL in case there is a redirect.</p>
  <p>Does anyone know what should I add on the script, I'm not that savy on the matter.</p>
  <p>Thanks in advance</p>