コード例 #1
0
        internal static SimpleTwitterCache GetInstance(ITrumpsTwitterService service, IRuntimeContext context)
        {
            if (instance == null)
            {
                instance = new SimpleTwitterCache(service, context);
            }

            return(instance);
        }
コード例 #2
0
        public List <ITweet> GetTrumpsTweets()
        {
            List <ITweet> rawTweets = SimpleTwitterCache.GetInstance(_service, _context).GetTweets();

            List <ITweet> filteredTweets = new List <ITweet>();

            if (!_context.AdultMessagesAllowed)
            {
                filteredTweets = rawTweets.FindAll(t => t.Classification != TweetClassification.sexualHarrasment);
            }
            else
            {
                filteredTweets = rawTweets;
            }
            return(filteredTweets);
        }