Move liked post IDs parsing to new configuration parser.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / ConfigurationSoneParser.java
index 01d3221..3cb3b68 100644 (file)
@@ -136,6 +136,20 @@ public class ConfigurationSoneParser {
                return replies;
        }
 
+       public Set<String> parseLikedPostIds() {
+               Set<String> likedPostIds = new HashSet<String>();
+               while (true) {
+                       String likedPostId =
+                                       getString("/Likes/Post/" + likedPostIds.size() + "/ID",
+                                                       null);
+                       if (likedPostId == null) {
+                               break;
+                       }
+                       likedPostIds.add(likedPostId);
+               }
+               return likedPostIds;
+       }
+
        public static class InvalidPostFound extends RuntimeException { }
 
        public static class InvalidPostReplyFound extends RuntimeException { }