Skip to content

Commit 5909071

Browse files
committed
added Gilded and Controversial Listing properties to Subreddit
1 parent 0b243c0 commit 5909071

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

RedditSharp/Things/Subreddit.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public class Subreddit : Thing
1616
private const string SubredditHotUrl = "/r/{0}/hot.json";
1717
private const string SubredditRisingUrl = "/r/{0}/rising.json";
1818
private const string SubredditTopUrl = "/r/{0}/top.json?t={1}";
19+
private const string SubredditControversialUrl = "/r/{0}/controversial.json";
20+
private const string SubredditGildedUrl = "/r/{0}/gilded.json";
1921
private const string SubscribeUrl = "/api/subscribe";
2022
private const string GetSettingsUrl = "/r/{0}/about/edit.json";
2123
private const string GetReducedSettingsUrl = "/r/{0}/about.json";
@@ -186,6 +188,31 @@ public Listing<Post> Rising
186188
return new Listing<Post>(Reddit, string.Format(SubredditRisingUrl, Name), WebAgent);
187189
}
188190
}
191+
/// <summary>
192+
/// List of Controversial posts
193+
/// </summary>
194+
public Listing<Post> Controversial
195+
{
196+
get
197+
{
198+
if (Name == "/")
199+
return new Listing<Post>(Reddit, "/.json", WebAgent);
200+
return new Listing<Post>(Reddit, string.Format(SubredditControversialUrl, Name), WebAgent);
201+
}
202+
}
203+
/// <summary>
204+
/// List of gilded things
205+
/// </summary>
206+
public Listing<VotableThing> Gilded
207+
{
208+
get
209+
{
210+
if (Name == "/")
211+
return new Listing<VotableThing>(Reddit, "/.json", WebAgent);
212+
return new Listing<VotableThing>(Reddit, string.Format(SubredditGildedUrl, Name), WebAgent);
213+
}
214+
}
215+
189216
/// <summary>
190217
/// List of items in the mod queue
191218
/// </summary>

0 commit comments

Comments
 (0)