Example #1
0
        /// <summary>
        ///     Reports the jodel.
        /// </summary>
        /// <param name="postId"></param>
        /// <param name="reason"></param>
        public void ReportJodel(string postId, Moderation.Reason reason)
        {
            string rea = Convert.ChangeType(reason, reason.GetTypeCode())?.ToString(); // get int from enum.
            string stringifiedPayload = @"{""reason_id"":" + rea + "}";

            using (var client = new MyWebClient())
            {
                client.Headers.Add(Constants.Header.ToHeader(stringifiedPayload, DateTime.UtcNow, true));
                client.Encoding = Encoding.UTF8;
                client.UploadData(Constants.LinkReportJodel.ToLink(_user.AccessToken, postId), "PUT", new byte[] { });
            }
        }
Example #2
0
        public void DeleteJodel(string postId)
        {
            DateTime dt = DateTime.UtcNow;

            string stringifiedPayload =
                @"PUT%api.go-tellm.com%443%/api/v2/posts/" + postId + "%" + _user.AccessToken + "%" + $"{dt:s}Z" +
                "%%";

            using (var client = new MyWebClient())
            {
                client.Headers.Add(Constants.Header.ToHeader(stringifiedPayload, DateTime.UtcNow, true));
                client.Encoding = Encoding.UTF8;
                client.UploadData(Constants.LinkDeleteJodel.ToLink(_user.AccessToken, postId), "DELETE", new byte[] { });
            }
        }
Example #3
0
            /// <summary>
            ///     Unfollows a channel.
            /// </summary>
            /// <param name="channel"></param>
            public void UnfollowChannel(string channel)
            {
                if (channel[0] == '#')
                {
                    channel = channel.Remove(0, 1);
                }

                DateTime dt = DateTime.UtcNow;

                string stringifiedPayload =
                    @"PUT%api.go-tellm.com%443%/api/v3/user/unfollowChannel?access_token=" + _user.AccessToken + "%" +
                    "&channel=" + channel + $"{dt:s}Z" + "%%";

                using (var client = new MyWebClient())
                {
                    client.Headers.Add(Constants.Header.ToHeader(stringifiedPayload, DateTime.UtcNow));
                    client.Encoding = Encoding.UTF8;
                    client.UploadData(Constants.LinkUnfollowChannel.ToLink(channel), "PUT", new byte[] { });
                }
            }