Marketwatcher Source Code: Fetching Windows Phone App Reviews
Join the DZone community and get the full member experience.
Join For FreeSample application
The Marketwatcher GitHub repository contains a sample app which can used to check out how the library is used.
Review data
At the moment an app review is described with the following model:
public string Id { get; private set; } public string Author { get; private set; } public DateTime UpdateTime { get; private set; } public int Score { get; private set; } public string Comments { get; private set; } public string CountryCode { get; private set; }
Implementation
Marketwatcher uses the Reactive Extensions. It may be that the RX is dropped at some point in favor of a implementation that doesn’t require any other DLLs. The library also references System.ServiceModel.Syndication which is used to parse the review data. The referenced dlls are included in the repository.
Usage
Marketwatcher.Fetcher:
Use either:
public IObservable<List<Review>> FetchReviewsForApp(string appId)
or
public IObservable<List<Review>> FetchReviewsForAppFromOneMarketplace(string appId, string marketplaceCountryCode)
In the app you can subscribe to these. The following example is from the sample app:
var fetcher = new Fetcher(); progressIndicator.IsVisible = true; var reviews = new ObservableCollection<Review>(); Items.ItemsSource = reviews; fetcher.FetchReviewsForApp(this.Appid.Text) .ObserveOn(SynchronizationContext.Current) .Subscribe(x => { foreach (var review in x) { reviews.Add(review); } }, ex => Debug.WriteLine("error"), () => progressIndicator.IsVisible = false);
Nuget
The Nuget package is coming!
Download
Source: http://mikaelkoskinen.net/post/Marketwatcher-WP7-Class-Library-and-Sample-Application-for-Fetching-Application-Reviews-from-the-Marketplace.aspx
Opinions expressed by DZone contributors are their own.
Comments