Exemple #1
0
        private DYKStatusTemplate CheckValidness(MediaWiki wiki, string title)
        {
            var validThrough = GetValidThroughTime(wiki, title, DateTimeOffset.UtcNow);

            return(validThrough == null
                ? DYKStatusTemplate.Missing()
                : DYKStatusTemplate.Valid(validThrough.Value));
        }
Exemple #2
0
        private DYKStatusTemplate CheckStatus(MediaWiki wiki, string title)
        {
            var text = wiki.GetPage(title, followRedirects: true);

            if (text == null)
            {
                return(DYKStatusTemplate.Missing());
            }
            else if (ForDeletionRegex.IsMatch(text))
            {
                return(DYKStatusTemplate.ForDeletion());
            }
            else if (Encoding.UTF8.GetByteCount(text) < MinArticleSize)
            {
                return(DYKStatusTemplate.Small());
            }
            else
            {
                return(null);
            }
        }