public Attachment GetMarketCap() { string coinmarketCapEndPoint = "https://api.coinmarketcap.com/v1/global/"; string jsonResponse = GetHttpResponse.GetJsonResponse(coinmarketCapEndPoint); CoinMarketCapResponseModel coinMarketCapResponse = JsonConvert.DeserializeObject <CoinMarketCapResponseModel>(jsonResponse); var returnHero = CreateContextCard.GetHeroCard(coinMarketCapResponse.total_market_cap_usd.AddCommasAndCultureInfo("$")); return(returnHero); }
public Attachment GetRandomGifBasedOnSearchCritera(string searchCritera) { const string giphyApiKey = "ROSoLz0Iz8suznXXf1KOQ4a7RgjOSTS8"; string giphyEndPoint = $"https://api.giphy.com/v1/gifs/random?api_key={giphyApiKey}&tag={searchCritera}&rating=G"; string jsonResponse = GetHttpResponse.GetJsonResponse(giphyEndPoint); var stronglyTypedGiphyResponse = JsonConvert.DeserializeAnonymousType(jsonResponse, new GiphyResponse()); List <MediaUrl> mediaUrl = new List <MediaUrl>(); mediaUrl.Add(new MediaUrl() { Profile = "image/gif", Url = stronglyTypedGiphyResponse.Data.GiphyImages.GiphyInnerObject.Mp4 }); return(CreateContextCard.GetAnimationCard(mediaUrl: mediaUrl, autoLoop: true, autoStart: true)); }