Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #200

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/README-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,20 @@ List<Item> footballArticles = rssFeed.filter(i -> i.getTitle().equals(Optional.o
```

### Read feed from a file
Reading from file using InputStream
```java
InputStream file = new FileInputStream("Path to file");
List<Item> items = new RssReader().read(file);
InputStream inputStream = new FileInputStream("/path/to/file");
List<Item> items = new RssReader().read(inputStream);
.toList();
```

Reading from file using file URI
```java
List<Item> items = new RssReader().read("file:/path/to/file");
.toList();
```


### Read from multiple feeds
Read from multiple feeds into a single stream of items sored in descending (newest first) publication date order and prints the title.
```java
Expand All @@ -62,7 +70,12 @@ new RssReader().read(urls)

To change sort order to ascending (oldest first) publication date
```java
.sorted(ItemComparator.oldestItemFirst())
.sorted(ItemComparator.oldestPublishedItemFirst())
```
For sorting on updated date instead of publication date
```java
.sorted(ItemComparator.newestUpdatedItemFirst())
.sorted(ItemComparator.oldestUpdatedItemFirst())
```


Expand Down