private static async Task <string> GetMovie(string movieUrl) { string pattern1 = "/movie/trailer.*[0-9]\""; string pattern2 = "http.*.mp4"; string temp = await HttpServices.SendGetRequestAsync(movieUrl); string regular = RegexService.RegexAdapt(pattern1, temp); movieUrl = movieUrl.Remove(20); movieUrl += regular.Remove(regular.LastIndexOf("\"")); temp = await HttpServices.SendGetRequestAsync(movieUrl); regular = RegexService.RegexAdapt(pattern2, temp); return(regular); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); parameters = e.Parameter as Subject; string subjectUrl = "https://api.douban.com/v2/movie/subject/"; subjectUrl += parameters.id; string commentsUrl = subjectUrl + "/comments?" + key; string reviewsUrl = subjectUrl + "/reviews?" + key; reviewsList = new ReviewsCollection(reviewsUrl); commentsList = new CommentsCollection(commentsUrl); string subjectStream = await HttpServices.SendGetRequestAsync(subjectUrl); subjectData = JsonToObject.DataContract <Models.FilmDetails>(subjectStream); Summary.Text = " " + subjectData.summary; foreach (var a in parameters.pubdates) { Pubdate.Text += "/" + a; } filmDetailsLoadingRing.IsActive = false; }