Example #1
0
        public RedditSession(Configuration config)
        {
            Config = config;

            Serializer = new XmlSerializer(typeof(Data));

            using (FileStream fileStream = new FileStream("data.xml", FileMode.Open))
            {
                Data = (Data)Serializer.Deserialize(fileStream);
            }

            TrackedComments = new List <JsonCommentsRequestContentBaseDataComment>();

            foreach (string CommentID in Data.CommentData.TrackedCommentIDs.ID)
            {
                JsonCommentsRequestContentBaseDataComment temp = new JsonCommentsRequestContentBaseDataComment();
                temp.data             = new JsonCommentsRequestContentBaseDataCommentData();
                temp.data.name        = CommentID;
                temp.data.created_utc = Data.CommentData.LastScannedUTCValue;
                TrackedComments.Add(temp);
            }

            RedditClient = new RestClient("https://www.reddit.com");
            RedditClient.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(Config.AppDetails.Id, Config.AppDetails.Secret);

            OauthRestClient = new RestClient("https://oauth.reddit.com");

            Authenticate();
        }
        public override bool Equals(object obj)
        {
            JsonCommentsRequestContentBaseDataComment comment = obj as JsonCommentsRequestContentBaseDataComment;

            return(this.data.name == comment.data.name);
        }