Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/zandero/sitemap
- Owner: zandero
- License: apache-2.0
- Created: 2017-03-09T11:57:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T10:26:37.000Z (almost 8 years ago)
- Last Synced: 2024-11-08T14:15:18.460Z (about 2 months ago)
- Topics: reader, sitemap, writer
- Language: Java
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```