@@ -2,7 +2,7 @@ import { createId } from "@/lib/api/create-id";
22import { prisma } from "@dub/prisma" ;
33import "dotenv-flow/config" ;
44import { XMLParser } from "fast-xml-parser" ;
5- import { bulkCreateLinks } from "../lib/api/links" ;
5+ import { bulkCreateLinks } from "../lib/api/links/bulk-create-links " ;
66
77async function fetchSitemap ( url : string ) {
88 const response = await fetch ( url ) ;
@@ -14,19 +14,21 @@ async function fetchSitemap(url: string) {
1414
1515const sitemapUrl = "https://dub.co/sitemap.xml" ;
1616const domain = "site.dub.co" ;
17- const projectId = "xxx " ;
18- const userId = "xxx " ;
19- const folderId = "xxx " ;
17+ const projectId = "ws_xxx " ;
18+ const userId = "user_xxx " ;
19+ const folderId = "fold_xxx " ;
2020
2121async function main ( ) {
2222 // Fetch and parse sitemap
2323 const sitemapUrls = await fetchSitemap ( sitemapUrl ) ;
2424
25- // Filter out homepage and invalid URLs
2625 const validUrls = sitemapUrls
26+ // filter out other sitemaps
27+ . filter ( ( url : string ) => ! url . endsWith ( "sitemap.xml" ) )
2728 . map ( ( url : string ) => {
2829 const urlObj = new URL ( url ) ;
2930 let key = urlObj . pathname . slice ( 1 ) ;
31+ // convert homepage to _root
3032 if ( key === "" ) {
3133 key = "_root" ;
3234 }
0 commit comments