Esempio n. 1
0
        private static void GetTrending()
        {
            string key          = DateTime.Today.ToString() + "_Trending";
            var    giphyRecords = GetFromCache(key);

            if (giphyRecords == null)
            {
                var response = GiphyInfo.GetTrending();
                giphyRecords = response.GiphyRecords;
                AddToCache(key, giphyRecords);
            }

            PrintResults(giphyRecords);
        }
Esempio n. 2
0
        private static void GetBySearchTerm()
        {
            Console.WriteLine(Environment.NewLine + "Please enter a search term");
            string searchTerm = Console.ReadLine();


            string key          = searchTerm + "_searchTerm";
            var    giphyRecords = GetFromCache(key);

            if (giphyRecords == null)
            {
                var response = GiphyInfo.GetBySearch(searchTerm);
                giphyRecords = response.GiphyRecords;
                AddToCache(key, giphyRecords);
            }

            PrintResults(giphyRecords);
        }