Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit a599f92

Browse files
committed
Save weekly rant number
1 parent 964a2ee commit a599f92

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/scorpiac/javarant/DevRant.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public class DevRant {
5757
private boolean hideReposts = false;
5858
private int numNotifs;
5959
private News news;
60+
private int weeklyRantNumber = -1;
6061

6162
/**
6263
* Log in to devRant.
@@ -421,6 +422,10 @@ private JsonObject executeRequest(Request request) {
421422
if (json.has("news"))
422423
news = News.fromJson(json.get("news").getAsJsonObject());
423424

425+
// Save the weekly rant number.
426+
if (json.has("wrw"))
427+
weeklyRantNumber = json.get("wrw").getAsInt();
428+
424429
return json;
425430
}
426431

@@ -469,4 +474,11 @@ public int getNotifCount() {
469474
public News getNews() {
470475
return news;
471476
}
477+
478+
/**
479+
* Get the weekly rant number, or -1 if this has not yet been set.
480+
*/
481+
public int getWeeklyRantNumber() {
482+
return weeklyRantNumber;
483+
}
472484
}

0 commit comments

Comments
 (0)