Change feed type to atom
This commit is contained in:
parent
e0a8a237a4
commit
e559508507
@ -28,6 +28,8 @@ import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.Date;
|
||||
import java.util.logging.FileHandler;
|
||||
@ -269,14 +271,15 @@ public class Main extends Application {
|
||||
feed = input.build(new File(rssPath.toString()));
|
||||
} else {
|
||||
feed = new SyndFeedImpl();
|
||||
feed.setFeedType("rss_1.0");
|
||||
feed.setFeedType("atom_1.0");
|
||||
feed.setTitle("Blog");
|
||||
feed.setLink(loadedStation.getAddress());
|
||||
feed.setDescription("Sample blog");
|
||||
}
|
||||
|
||||
SyndEntry entry = new SyndEntryImpl();
|
||||
entry.setTitle("TODO: date?");
|
||||
String timestamp = ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT);
|
||||
entry.setTitle(timestamp);
|
||||
entry.setLink(loadedStation.getAddress());
|
||||
|
||||
SyndContent description = new SyndContentImpl();
|
||||
@ -286,6 +289,7 @@ public class Main extends Application {
|
||||
entry.setDescription(description);
|
||||
|
||||
feed.getEntries().add(entry);
|
||||
feed.setPublishedDate(new Date());
|
||||
|
||||
Writer writer = new FileWriter(rssPath.toString());
|
||||
SyndFeedOutput syndFeedOutput = new SyndFeedOutput();
|
||||
|
Loading…
x
Reference in New Issue
Block a user