Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Grand Exchange Parser
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-07-2011, 05:35 AM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Grand Exchange Parser

Here's a pretty basic program I whipped up in like an hour to parse the Grand Exchange, and list items and stuff. Yeah, that's it.



Code:
            listView1.Items.Clear();
            string ID, Name, Price, Change, Members;
            WebClient client = new WebClient();
            client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
            listView1.BeginUpdate();
            int CurrentPage = 0, PageCount = 0xFFFF;
            while (CurrentPage < PageCount)
            {
                string Source = client.DownloadString("http://services.runescape.com/m=itemdb_rs/results.ws?page=" + (CurrentPage + 1).ToString() + "&query=" + txtSearch.Text + "&price=all&members=");
                string[] ItemArray = Source.Split(new string[] { "<tr data-item-id=\"" }, System.StringSplitOptions.None);
                if (PageCount == 0xFFFF)
                {
                    PageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(Source.Split(new string[] { "<em>" }, System.StringSplitOptions.None)[2].Split(new string[] { "</em>" }, System.StringSplitOptions.None)[0]) / 20));
                }
                this.Text = "Downloading page " + (CurrentPage + 1).ToString() + " of " + PageCount.ToString();
                for (int i = 1; i <= ItemArray.Length - 1; i += 1)
                {
                    ID = ItemArray[i].Split(new string[] { "\">" }, System.StringSplitOptions.None)[0];
                    Name = ItemArray[i].Split(new string[] { "alt=\"" }, System.StringSplitOptions.None)[1].Split('"')[0];
                    Price = ItemArray[i].Split(new string[] { "<td class=\"price\">" }, System.StringSplitOptions.None)[1].Split(new string[] { "</td>" }, System.StringSplitOptions.None)[0];
                    Change = ItemArray[i].Split(new string[] { "<td class=\"neutral\">", "<td class=\"positive\">", "<td class=\"negative\">" }, System.StringSplitOptions.None)[1].Split(new string[] { "</td>" }, System.StringSplitOptions.None)[0];
                    Members = ItemArray[i].Split(new string[] { "title=\"" }, System.StringSplitOptions.None)[1].Split(new string[] { "\">" }, System.StringSplitOptions.None)[0];
                    listView1.Items.Add(Name);
                    listView1.Items[listView1.Items.Count - 1].SubItems.Add(Price);
                    listView1.Items[listView1.Items.Count - 1].SubItems.Add(Change);
                    listView1.Items[listView1.Items.Count - 1].SubItems.Add(Members);
                    listView1.Items[listView1.Items.Count - 1].SubItems.Add(ID);
                }
                CurrentPage++;
            }
            listView1.EndUpdate();
Slightly based off of this thread.

The code should be relatively self-explanatory.
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
  #2  
Old 12-09-2011, 09:48 AM
RSUltimate AREA SCAMMMERRS
 
Join Date: Nov 2011
Posts: 859
Default Re: Grand Exchange Parser

Code looks nice well done, you should post more in this category .
Reply With Quote
  #3  
Old 12-10-2011, 06:05 AM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Re: Grand Exchange Parser

Thanks it was my first shot at C# in ages. I've been only using C++ at university. Glad to see I haven't got any worse, I guess. :P

I used to be a Programming Mod here, so I hope you aren't too shocked that I'm here.
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
  #4  
Old 04-16-2012, 04:50 AM
Member
 
Join Date: Apr 2012
Posts: 82
Default Re: Grand Exchange Parser

would you like to sell all of your resourse code of it
Reply With Quote
  #5  
Old 04-16-2012, 05:59 AM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Re: Grand Exchange Parser

Quote:
Originally Posted by dongchan View Post
would you like to sell all of your resourse code of it
I don't understand.
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
  #6  
Old 04-16-2012, 08:35 PM
Newcomer
 
Join Date: Apr 2012
Posts: 23
Default Re: Grand Exchange Parser

Does this work for all the items of the ge?
Reply With Quote
  #7  
Old 04-17-2012, 10:06 AM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Re: Grand Exchange Parser

I don't see why not.
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
  #8  
Old 05-18-2012, 02:54 AM
Active Member
 
Join Date: May 2012
Posts: 194
Send a message via MSN to Unanime Send a message via Yahoo to Unanime
Default Re: Grand Exchange Parser

So this just shows the prices right? Not the variations
Reply With Quote
  #9  
Old 05-20-2012, 02:40 PM
Darthatron's Avatar
Massive Troll
Ex-Moderator Visual Basic Programmers
 
Join Date: May 2006
Location: The internet.
Posts: 1,604
Send a message via MSN to Darthatron
Default Re: Grand Exchange Parser

Right.
__________________
I do not trade.
Always ask for a PM.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 04:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1