public SelfPromotionCombustor( SelfPromotionCombustorSettings settings, RedditSharp.Reddit client ) : this() {
     RedditClient = client;
     Settings = settings;
     PercentageThreshold = settings.PercentageThreshold;
     IncludePostInPercentage = settings.IncludePostInPercentage;
     RemovalFlair = settings.RemovalFlair;
     GracePeriod = settings.GracePeriod;
 }
Example #2
0
 static IEnumerable<RedditSharp.ModeratorUser> GetModerators( string subName, RedditSharp.IWebAgent agent, RedditSharp.Reddit reddit )
 {
     var request = agent.CreateGet( string.Format( ModeratorsUrl, subName ) );
     var response = request.GetResponse();
     var responseString = agent.GetResponseString( response.GetResponseStream() );
     var json = JObject.Parse( responseString );
     var type = json["kind"].ToString();
     if ( type != "UserList" )
         throw new FormatException( "Reddit responded with an object that is not a user listing." );
     var data = json["data"];
     var mods = data["children"].ToArray();
     var result = new RedditSharp.ModeratorUser[mods.Length];
     for ( var i = 0; i < mods.Length; i++ ) {
         var mod = new RedditSharp.ModeratorUser( reddit, mods[i] );
         result[i] = mod;
     }
     return result;
 }
Example #3
0
        static void RecursivelyInspectComments(Func<Subs.Post, RedditSharp.Things.Comment, Subs.Comment, Subs.Comment> commentFunc,
            Subs.Post post, 
            RedditSharp.Things.Comment redditComment, 
            Subs.Comment parentComment = null)
        {
            if (redditComment.Kind == "more")
            {
                return;
            }

            if (redditComment.Kind != "t1")
            {
                return;
            }

            var comment = commentFunc(post, redditComment, parentComment);
            if (comment == null) return;

            foreach (var childRedditComment in redditComment.Comments)
            {
                RecursivelyInspectComments(commentFunc, post, childRedditComment, comment);
            }
        }
Example #4
0
 public AutoModWrangler( RedditSharp.Things.Subreddit subreddit ) {
     Subreddit = subreddit;
 }
Example #5
0
 public HighTechBanHammer( HighTechBanHammerSettings sets, RedditSharp.Things.Subreddit subreddit ) : this() {
     Settings = sets;
     Subreddit = subreddit;
 }