0

I'm building an application for those Xbox 360 achievements lovers. Right now I'm pretty much copying the Title, Description and Guide to a XML file (Which I have in my Dropbox). Then I retrieve this info to 3 text blocks and an image control.

Process:

Step 1:

Find the title: http://www.xbox360achievements.org/game/call-of-duty-modern-warfare-3/guide/

Step 2:

Copy & Paste all info to XML: https://dl.dropbox.com/u/27136243/AchivementHunters/XML/Achivements%26Guides%20-%20Example.xml

Step 3:

Download XML and read/display data

        XDocument dataFeed = XDocument.Parse(e.Result);
        try
        {
            if (NavigationContext.QueryString.TryGetValue("gameName", out gameName))
            {
                AchivementsListBox.ItemsSource = from query in dataFeed.Descendants(gameName)
                                                 select new NewGamesClass
                                                 {
                                                     TitleCode = (string)query.Element("TitleCode"),
                                                     GameTitle = (string)query.Element("Title"),
                                                     GameDescription = (string)query.Element("Description"),
                                                     GameGuide = (string)query.Element("Guide"),
                                                     GameImage = (string)query.Element("Image"),
                                                     GameVideoLink = (string)query.Element("VideoLink")
                                                 };
            }
        }
        catch
        {
            MessageBox.Show("Sorry, an error has ocurr while locating the achievement list.");
        }

Output:

enter image description here enter image description here

Now, I want to make my life easier by not finding, copying, and paste all the data manually. Is there anyway I can just access all this information straight from the website and display it in my app. I'm still in the process of learning programming, so I have no idea what to research to accomplish this. Can someone please direct me towards the right way plus give me some examples. thanks.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
chr.solr
  • 576
  • 1
  • 7
  • 19
  • Can you reformat the code so we don't have to scroll to the right to read it? I'd do it myself, but I'm not 100% sure I wouldn't break the syntax. – Keith Thompson Aug 02 '12 at 23:04
  • Use [HtmlAgilityPack](http://htmlagilitypack.codeplex.com/) to process the page... you don't need step 2. – Jeff Mercado Aug 02 '12 at 23:06
  • I've replaced the screen shots with smaller versions; they're still legible and don't take up so much space. – Keith Thompson Aug 02 '12 at 23:10
  • Thanks Keith. Hey Jeff can you provide me with an example. I'm trying the example provided in your link but it wont compile. – chr.solr Aug 02 '12 at 23:32

1 Answers1

0

You might want to look into using HtmlAgilityPack framework. I have used this for Windows Phone 7 development before and it works very well. There are a lot of examples (another) on this framework.

However, there might be conditions of use on the website you are gathering (scraping) this data from which you should look into before you continue and put in too much work.

Hope that helps.

Community
  • 1
  • 1
Darren Reid
  • 2,322
  • 20
  • 25
  • Lol, I never though about the conditions of the website. I will get on that before I continue this project. – chr.solr Aug 03 '12 at 03:52