Over a million developers have joined DZone.

Marketwatcher Source Code: Fetching Windows Phone App Reviews

· Mobile Zone
I’ve just committed the first working version of Marketwatcher, a library for Windows Phone 7 which can be used to fetch application reviews from the Windows Phone Marketplace. It is available from the GitHub and it’s licensed with MIT, so you can use the library anyway you want.

Get the source code.

Get the compiled binaries.

Sample 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

GitHub repository.

Binaries.


Source:  http://mikaelkoskinen.net/post/Marketwatcher-WP7-Class-Library-and-Sample-Application-for-Fetching-Application-Reviews-from-the-Marketplace.aspx


Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}