Home > Uncategorized > Capture hi-res image from iTunes using C#

Capture hi-res image from iTunes using C#

This is a quick demo of how to use the iTunes API to extract the hi-res icon of any iOS app;

WebClient wc = new WebClient();
string strUrl = @”http://itunes.apple.com/search?term=” + HttpUtility.UrlEncode(tbSearch.Text) + “&entity=iPadSoftware”;
string strHtml = wc.DownloadString(strUrl);
const string strArtRegex = “artworkUrl100.:\”(.*?)\””;
Match mArt = Regex.Match(strHtml, strArtRegex);
string Url = mArt.Groups[1].Value;
imgArtwork.Src = Url;

This assumes a user interface somewhat like this:

<asp:TextBox runat=”server” ID=”tbSearch”></asp:TextBox>
<asp:Button runat=”server” ID=”btnSearch” OnClick=”btnSearchClick” Text=”Search”/>
<br/>
<img id=”imgArtwork” runat=”server”/>

Hope this helps someone.

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: