Pricing (Scripts and Notes)
by Goblin Hero
Moderators: charmer, CCGHQ Admins
Re: Card Pricing
by Goblin Hero » 19 Mar 2010, 12:16
min/max/avg are calculated for different scripts, you can't set two prices for one card inside your script.
Progress text should be ok.
Progress text should be ok.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Re: Card Pricing
by woogerboy21 » 19 Apr 2010, 21:39
I can't tell if I have found a bug in the pricing or if my script has an error some were. I have attached an updated script for the mtgfanatic site and started to implement foil pricing along with progress bar status. I have managed to get the project bar status working but when I try and set the foil values for the cards I can see that the script is parsing the correct URL, along with the collecting the correct price but it does not look like its populating the foil price column in the ma application.
Goblin Hero can you take a look at this script and tell me if you see anything wrong with the script and how its populating the foil prices or did I find a bug in the multiple script foil routines?
edit: if you change the dbg variable to something other than "off" it will dump a bunch of data in the ma log file during parsing (probably nothing you cant already figure out)
Goblin Hero can you take a look at this script and tell me if you see anything wrong with the script and how its populating the foil prices or did I find a bug in the multiple script foil routines?
edit: if you change the dbg variable to something other than "off" it will dump a bunch of data in the ma log file during parsing (probably nothing you cant already figure out)
- Attachments
-
- MTGFanatic.zip
- (2.16 KiB) Downloaded 344 times
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by Goblin Hero » 26 Apr 2010, 14:48
Two things:woogerboy21 wrote:Ever get a chance to look at this?
1. Do not put the comma after the last entry before the '}' in the array.
2. Then calling ma.SetPrice() for foils card names are wrong - they have an extra space at the end.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Re: Card Pricing
by woogerboy21 » 28 Apr 2010, 16:52
Thanks for checking that for me! I finally have made it around to updating the script and now things appear to be working properly. If anyone is interested here is an updated form of the script that now does foil pricing. Also if Goblin King wants to take a look over it and point out anything that would better improve upon my lack of lua talent it would be much appriciated. If you like it, feel free to include it in the distro of the magic album application.
As it sits right now this script should be fairly easy to adapt to just about any site by updating the variables used to pattern match the block of code in the html response containing the card names and prices, as well as editing the array containing the site set information. I hope to be adapting the script to other sites shortly but would like to create an accepting script code structure before using it as any type of template for other sites.
edit: attached wrong originally, should be correct.
As it sits right now this script should be fairly easy to adapt to just about any site by updating the variables used to pattern match the block of code in the html response containing the card names and prices, as well as editing the array containing the site set information. I hope to be adapting the script to other sites shortly but would like to create an accepting script code structure before using it as any type of template for other sites.
edit: attached wrong originally, should be correct.
- Attachments
-
- MTGFanatic.zip
- (2.35 KiB) Downloaded 374 times
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by woogerboy21 » 28 Apr 2010, 19:04
Here is the pricing script I used for mtgfanatics only adapted to abugames. You can see how things changed between the sites if you are interested.
- Attachments
-
- ABUGames.zip
- (2.41 KiB) Downloaded 380 times
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by AsBest » 09 May 2010, 14:07
What about MOTL prices import?
http://www.magictraders.com/pricelists/
Is it possible to make a hotkey to switch between price sources?
http://www.magictraders.com/pricelists/
Is it possible to make a hotkey to switch between price sources?
-
AsBest - HQ Team Member
- Posts: 150
- Joined: 08 Nov 2009, 18:40
- Location: Ukraine
- Has thanked: 9 times
- Been thanked: 0 time
Re: Card Pricing
by woogerboy21 » 16 May 2010, 01:02
Goblin Hero can correct me if I am wrong or has any better suggestions but since the MA application requires you to specify a setid with the card name in order to set a value to a card the site that has prices must have a method for determining the card name to card set. In the cases such as mtgmint or other sites I have written scripts for prices are seperated by sets so you can query a page and get a value for a card and know its from a specific set. But since the magictraders site does not have a way to identify this I can't think of a way to import prices into the MA application using there site.AsBest wrote:What about MOTL prices import?
http://www.magictraders.com/pricelists/
Is it possible to make a hotkey to switch between price sources?
Now if there was a way to query the MA application database from the lua script for a card name and return all the sets associated to the card it would be possible (hint hint Goblin Hero)
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by GrimNotepad » 16 May 2010, 22:44
From what i can understand from reading the LUA
and my knowledge of LUA.
You would have to maintain or find a site that you can query to get a list of the current abbreviations and then cycle through them while querying:
I will work on this in the next week or so and see if i can get a working script for MOTL going.
One thing i need though is the API documentation for:
and my knowledge of LUA.
You would have to maintain or find a site that you can query to get a list of the current abbreviations and then cycle through them while querying:
- Code: Select all
http://magictraders.com/cgi-bin/set_query.cgi?set=ROE
I will work on this in the next week or so and see if i can get a working script for MOTL going.
One thing i need though is the API documentation for:
- Code: Select all
MA.SetPrice()
MA.SetPBar()
MA.GetURL()
MA.Log()
- Code: Select all
MA.SetPrice(InternalSetID, LanguageCode, CardName, ????, RegularPriceValue, FoilPriceValue)
MA.SetPBar(MessageToDisplay, TotalProgressTicks)
MA.GetURL() <- Returns TextDump of Webpage
MA.Log(Message) <- Global Logging of Events
- GrimNotepad
- Posts: 3
- Joined: 16 May 2010, 22:36
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Pricing
by woogerboy21 » 19 May 2010, 00:34
Not saying this isn't possible, just throwing my experience with writing pricing scripts for this and other products there is no defined list of product set to letter abbreviation for all the sets. For the newer sets there has been a 3 letter abbr and most of all sites use them but in older sets this is not always the case and a number of sources have used different abbr for set names. On top of that the motl site does not contain a set abbreviation listing for each listed card. I was curious how do you plan on identifying what set the card is a part of from a listing of cards that does not list the set abbr or name? You could assume if it does not have a set abbr that is only included in 1 set. It would be nice if Goblin Hero would write an api extension to query the MA application database for a card name and return all the card sets.GrimNotepad wrote:From what i can understand from reading the LUA
and my knowledge of LUA.
You would have to maintain or find a site that you can query to get a list of the current abbreviations and then cycle through them while querying:*See the SET= argument*
- Code: Select all
http://magictraders.com/cgi-bin/set_query.cgi?set=ROE
I will work on this in the next week or so and see if i can get a working script for MOTL going.
One thing i need though is the API documentation for:*or just confirm my test of understanding*
- Code: Select all
MA.SetPrice()
MA.SetPBar()
MA.GetURL()
MA.Log()
- Code: Select all
MA.SetPrice(InternalSetID, LanguageCode, CardName, ????, RegularPriceValue, FoilPriceValue)
MA.SetPBar(MessageToDisplay, TotalProgressTicks)
MA.GetURL() <- Returns TextDump of Webpage
MA.Log(Message) <- Global Logging of Events
Also..
If you are attempting to find a set name to set abbreviation you can query the sets.csv file under the "database" tab.
Edit:
I wonder if there is a way to query the gatherer for this information?
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by GrimNotepad » 19 May 2010, 01:31
i was going to just hard code the abbreviations for now while i looked for a site that listed it and then replace the code with a look at the site
i like the idea of api extension to look back into the MA database, could make it easier.
due to your previous experience with the pricing scripts can you confirm my suspicions on what each function does (see the third code section in my previous post)
i like the idea of api extension to look back into the MA database, could make it easier.
due to your previous experience with the pricing scripts can you confirm my suspicions on what each function does (see the third code section in my previous post)
- GrimNotepad
- Posts: 3
- Joined: 16 May 2010, 22:36
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Pricing
by woogerboy21 » 19 May 2010, 02:06
Your explinations of each api function looks correct. Here's how I would explain it though just incase I am mis-interpreting your explination:GrimNotepad wrote:i was going to just hard code the abbreviations for now while i looked for a site that listed it and then replace the code with a look at the site
i like the idea of api extension to look back into the MA database, could make it easier.
due to your previous experience with the pricing scripts can you confirm my suspicions on what each function does (see the third code section in my previous post)
- Code: Select all
MA.SetPrice(InternalSetID, CardLanguage, CardName, ????, RegularPriceValue, FoilPriceValue) [setting 0 to a card value tells the ma app no value]
MA.SetPBar(MessageToDisplay, OverallTotalProgress)
MA.GetURL() <- Fetches URL and Returns TextDump of Webpage
MA.Log(Message) <- Writes information into the ma log. [Not exactly global logging since the data isnt stored any were for future processing]
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
- GrimNotepad
- Posts: 3
- Joined: 16 May 2010, 22:36
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Pricing
by woogerboy21 » 19 May 2010, 02:17
One place you might think about querying is magiccards.infoGrimNotepad wrote:awesome i will start on the script.
Using a query like this would return card data that might work:
- Code: Select all
http://magiccards.info/query?q=%2B%2Bo%21%22{CARDNAME}%22&v=olist
- Code: Select all
http://magiccards.info/query?q=%2B%2Bo%21%22Air Elemental%22&v=olist
You might try crystalkeep.com
Example:
- Code: Select all
http://crystalkeep.com/cgi-bin/magicsearch.cgi?cardName=air+elemental&partialCardName=&cardColour=&cardType=&creatureType=&expansion=&rarity=&cardText=&rulingText=
Man I am tired
-
woogerboy21 - HQ Team Member
- Posts: 1136
- Joined: 19 Jul 2009, 00:15
- Location: USA
- Has thanked: 21 times
- Been thanked: 152 times
Re: Card Pricing
by Goblin Hero » 19 May 2010, 05:52
Card version.woogerboy21 wrote:For the life of me I can't think of what the ??? text value in the setprice function is.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Who is online
Users browsing this forum: No registered users and 30 guests