Step 1: Create a Google Sheet called "Blog Directory"
Step 2: Find your sitemap URL
How to find your site map (works 99% of the time)
- Paste your URL + robots.txt in a browser (example: https://gokickflip.com/robots.txt)
- Copy and paste your sitemap (example: https://gokickflip.com/server-sitemap.xml)
Notion-Style Callout
💡 Need something more complex and customized to your flow & tools?
Let's talk (15 min).
Step 3: Add this script to your Sheet to extract all blog URLs from your sitemap
- In your sheet, head to Extensions --> App Scripts
- Paste the code below (update PASTE YOUR SITEMAP URL HERE in the code) and click "Save"
function getYourBlogUrls() {
var sitemapUrl = "PASTE YOUR SITEMAP URL HERE";
var response = UrlFetchApp.fetch(sitemapUrl, {muteHttpExceptions: true});
var xml = XmlService.parse(response.getContentText());
var root = xml.getRootElement();
var ns = XmlService.getNamespace("http://www.sitemaps.org/schemas/sitemap/0.9");
var urls = root.getChildren("url", ns);
var result = [];
urls.forEach(function(entry) {
var loc = entry.getChild("loc", ns).getText();
if (loc.indexOf("/blog/") > -1) { // only blog URLs
result.push([loc]);
}
});
return result.length ? result : [["No /blog/ URLs found"]];
}
- Name the first column "Blog URLs" and second column "Schema"
- Replace the second row's first field with "=getYourBlogUrls()" and hit enter (this will call the script we just saved)
Step 4: Run the Relay.app agent