protected internal Subreddit(Reddit reddit, JToken json, IWebAgent webAgent) : base(json) { Reddit = reddit; WebAgent = webAgent; Wiki = new Wiki(reddit, this, webAgent); JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings); Name = Url.ToString(); if (Name.StartsWith("/r/")) Name = Name.Substring(3); if (Name.StartsWith("r/")) Name = Name.Substring(2); Name = Name.TrimEnd('/'); }
protected internal Subreddit(Reddit reddit, JToken json, IWebAgent webAgent) : base(json) { Reddit = reddit; WebAgent = webAgent; Wiki = new Wiki(reddit, this, webAgent); JsonConvert.PopulateObject(json["data"].ToString(), this, reddit.JsonSerializerSettings); Name = Url.ToString(); if (Name.StartsWith("/r/")) { Name = Name.Substring(3); } if (Name.StartsWith("r/")) { Name = Name.Substring(2); } Name = Name.TrimEnd('/'); }
private void CreateWikiPage( Wiki wiki ) { Version = Program.VersionNumber; RunEveryXMinutes = 10; LastModified = DateTime.UtcNow; ReportScoreThreshold = -1; RemoveScoreThreshold = -1; /*** Module Settings ***/ LicensingSmasher = new LicensingSmasherSettings(); YouTubeSpamDetector = new YouTubeSpamDetectorSettings(); UserStalker = new UserStalkerSettings(); SelfPromotionCombustor = new SelfPromotionCombustorSettings(); /*** End Module Settings ***/ wiki.EditPage( WikiPageName, JsonConvert.SerializeObject( this, Formatting.Indented, new StringEnumConverter()).Replace("\r\n ","\r\n\r\n ") ); wiki.SetPageSettings( WikiPageName, new WikiPageSettings { Listed = false, PermLevel = 2 } ); }