Exemplo n.º 1
0
        public async Task <MoonwalkModel[]> GetFilmByName(string filmName)
        {
            try
            {
                string url    = $"{Enumerator.GetMoonwalkUrl}title={filmName}&api_token={Enumerator.GetMoonwalkToken[0]}";
                var    result = await iWebClientHelper.GetWebReuestAsync <MoonwalkModel[]>(url);

                foreach (var item in result)
                {
                    if (item.title_en != null)
                    {
                        var imdbResult = await imdbService.GetFilmByName(item.title_en);

                        if (imdbResult.Poster != null)
                        {
                            item.posret = imdbResult.Poster;
                        }
                    }
                }
                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }
Exemplo n.º 2
0
        public async Task <GoogleBookModel> GetBooksByNameAsync(string name, int startIndex = 0, int itemsOnPage = 12)
        {
            string url = $"{Enumerator.GetGoogleBooksApiUrl}{name}{"&startIndex="}{startIndex}{"&maxResults="}{itemsOnPage}";

            var result = await iWebClientHelper.GetWebReuestAsync <GoogleBookModel>(url);

            return(result);
        }
Exemplo n.º 3
0
        public async Task <ImdbEntity> GetFilmByName(string filmName)
        {
            try
            {
                string url    = $"{Enumerator.GetImDbApiUrl}{filmName}&{Enumerator.GetImDbapiToken}";
                var    result = await iWebClientHelper.GetWebReuestAsync <ImdbEntity>(url);

                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }