Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zandero/sitemap

Simple sitemap.xml builder
https://github.com/zandero/sitemap

reader sitemap writer

Last synced: 2 days ago
JSON representation

Simple sitemap.xml builder

Awesome Lists containing this project

README

        

# sitemap
Simple `sitemap.xml` generator and reader for single sitemap.xml files.

## Setup
```xml

com.zandero
sitemap
1.0

```

## Sitemap generator

```java
SitemapGenerator generator = new SitemapGenerator("http://some.domain.com");

// build a page link
WebPage page = new WebPage("/this/site")
.change(ChangeFrequency.daily)
.modified(1476796504000L)
.priority(0.6D);

// add new page to list
generator.add(page);

// generate list
List map = generator.generate();
```

### Output
```xml


http://some.domain.com/this/site
2016-10-18T15:15:04.000Z
daily
0.6

```

## Sitemap reader

Reads in a given XML file or String and de-serializes it to list of WebPages

```java
SitemapReader reader = new SitemapReader();
List pages = reader.read(sitemap);
```