From c9ef9cbd0cea90e306238d740990ae7666cfc227 Mon Sep 17 00:00:00 2001 From: Christian Torbidone Date: Thu, 1 Aug 2024 15:26:32 +0200 Subject: [PATCH] First Commit --- sitemap.xml | 21 --------------------- src/main/kotlin/Main.kt | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 sitemap.xml diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index 4ce8455..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - https://www.example.com/ - 2024-07-01 - monthly - 1.0 - - - https://www.example.com/about - 2024-07-01 - monthly - 0.8 - - - https://www.example.com/contact - 2024-07-01 - monthly - 0.8 - - diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index dec628d..294aee7 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -3,12 +3,20 @@ package org.thundernetwork.sitemap import org.thundernetwork.sitemap.models.UrlEntry fun main() { - val urlEntries = listOf( - UrlEntry("https://www.example.com/", "2024-07-01", "monthly", 1.0), - UrlEntry("https://www.example.com/about", "2024-07-01", "monthly", 0.8), - UrlEntry("https://www.example.com/contact", "2024-07-01", "monthly", 0.8) - ) + val large = true // Imposta questo valore in base alle tue esigenze + val path = "sitemaps.xml" // Imposta il percorso dove salvare le sitemaps - val generator = SitemapGenerator(urlEntries) - generator.generateSitemap("sitemap.xml") + val generator = SitemapGenerator(large, path) + + // Carica una sitemap esistente + generator.loadSitemap("sitemap.xml") + + // Aggiungi nuovi URL + generator.addUrl(UrlEntry("https://www.example.com/about", "2024-08-01", "weekly", 0.9)) + + // Rimuovi un URL + generator.removeUrl("https://www.example.com/old-page") + + // Genera la sitemap aggiornata + generator.generateSitemap() }