Page 21 of 22

Re: Pricing (Scripts and Notes)

PostPosted: 12 Oct 2012, 05:49
by Goblin Hero
LordHelmchen wrote:Note that the section
Code: Select all
&nbsp;<span class="textNote">(€0.61)</span>                                    </td>
is replaced with
Code: Select all
&nbsp;                                    </td>
, which puts a stop on my efforts to adapt my sript to mtmintcard... Any ideas or even remedies would be appreciated.
May be site uses cookies... I do not know.

Re: Pricing (Scripts and Notes)

PostPosted: 29 Jan 2013, 13:57
by Golob
The problem I have with Mint Cards pricings is that they massively overprice worthless cards i.e. trashy commons are like $.25...

Since TCGPlayer.com launched Price Guides (magic.tcgplayer.com/magic_price_guides.asp) which are (I guess) really easy to be parsed, would anyone mind spending half an hour of their time to add a pricing script for this site?


Inside the script there could be an option to choose witch price to get with defaulting to low. It mixes regular cards with foils, so low price should be somewhere around the price for a regular card (unless that edition has only foils).

I managed to prepare the avsets table for this:
AVSETS | Open
Code: Select all
avsets =   {
   {id = 793, foil = "Y", url = "Gatecrash"},
   {id = 791, foil = "Y", url = "Return to Ravnica"},
   {id = 790, foil = "N", url = "Duel Decks: Garruk vs. Liliana"},
   {id = 789, foil = "O", url = "From the Vault%3A Realms"},
   {id = 788, foil = "Y", url = "Magic 2013 (M13)"},
   {id = 787, foil = "N", url = "Planechase 2012"},
   {id = 786, foil = "Y", url = "Avacyn Restored"},
   {id = 785, foil = "Y", url = "Venser vs. Koth"},
   {id = 784, foil = "Y", url = "Dark Ascension"},
   {id = 783, foil = "O", url = "Graveborn"},
   {id = 782, foil = "Y", url = "Innistrad"},
   {id = 781, foil = "Y", url = "Ajani vs. Nicol Bolas"},
   {id = 780, foil = "O", url = "From the Vault%3A Legends"},
   {id = 779, foil = "Y", url = "Magic 2012 (M12)"},
   {id = 778, foil = "N", url = "Commander"},
   {id = 777, foil = "Y", url = "Knights vs. Dragons"},
   {id = 776, foil = "Y", url = "New Phyrexia"},
   {id = 775, foil = "Y", url = "Mirrodin Besieged"},
   {id = 774, foil = "O", url = "Premium Deck Series: Fire and Lightning"},
   {id = 773, foil = "Y", url = "Scars of Mirrodin"},
   {id = 772, foil = "Y", url = "Duel Decks: Elspeth vs. Tezzeret"},
   {id = 771, foil = "O", url = "From the Vault%3A Relics"},
   {id = 770, foil = "Y", url = "Magic 2011 (M11)"},
   {id = 769, foil = "N", url = "Archenemy"},   
   {id = 768, foil = "Y", url = "Duels of the Planeswalkers"},
   {id = 767, foil = "Y", url = "Rise of the Eldrazi"},
   {id = 766, foil = "N", url = "Duel Decks: Phyrexia vs. The Coalition"},
   {id = 765, foil = "Y", url = "Worldwake"},
   {id = 764, foil = "O", url = "Premium Deck Series: Slivers"},
   {id = 763, foil = "Y", url = "Garruk VS Liliana"},
   {id = 762, foil = "Y", url = "Zendikar"},
   {id = 761, foil = "N", url = "Planechase"},   
   {id = 759, foil = "Y", url = "Magic 2010"},
   {id = 758, foil = "Y", url = "Alara Reborn"},
   {id = 757, foil = "Y", url = "Duel Decks: Divine vs. Demonic"},
   {id = 756, foil = "Y", url = "Conflux"},
   {id = 755, foil = "Y", url = "Duel Decks: Jace vs. Chandra"},
   {id = 754, foil = "Y", url = "Shards of Alara"},
   {id = 752, foil = "Y", url = "Eventide"},
   {id = 751, foil = "Y", url = "Shadowmoor"},
   {id = 750, foil = "Y", url = "Morningtide"},
   {id = 740, foil = "Y", url = "Duel Decks: Elves vs. Goblins"},   
   {id = 730, foil = "Y", url = "Lorwyn"},
   {id = 720, foil = "Y", url = "10th Edition"},
   {id = 710, foil = "Y", url = "Future Sight"},
   {id = 700, foil = "Y", url = "Planar Chaos"},
   {id = 690, foil = "Y", url = "Timeshifted"},
   {id = 680, foil = "Y", url = "Time Spiral"},
   {id = 670, foil = "Y", url = "Coldsnap"},
   {id = 660, foil = "Y", url = "Dissension"},
   {id = 650, foil = "Y", url = "Guildpact"},
   {id = 640, foil = "Y", url = "Ravnica"},
   {id = 630, foil = "Y", url = "9th Edition"},
   {id = 620, foil = "Y", url = "Saviors of Kamigawa"},
   {id = 610, foil = "Y", url = "Betrayers of Kamigawa"},
   {id = 600, foil = "N", url = "Unhinged"},
   {id = 590, foil = "Y", url = "Champions of Kamigawa"},
   {id = 580, foil = "Y", url = "Fifth Dawn"},
   {id = 570, foil = "Y", url = "Darksteel"},
   {id = 560, foil = "Y", url = "Mirrodin"},
   {id = 550, foil = "Y", url = "8th Edition"},
   {id = 540, foil = "Y", url = "Scourge"},
   {id = 530, foil = "Y", url = "Legions"},
   {id = 520, foil = "Y", url = "Onslaught"},
   {id = 510, foil = "Y", url = "Judgment"},
   {id = 500, foil = "Y", url = "Torment"},
   {id = 490, foil = "N", url = "Deckmaster"},
   {id = 480, foil = "Y", url = "Odyssey"},
   {id = 470, foil = "Y", url = "Apocalypse"},
   {id = 460, foil = "Y", url = "7th Edition"},
   {id = 450, foil = "Y", url = "Planeshift"},
   {id = 440, foil = "Y", url = "Beatdown Box Set"},
   {id = 430, foil = "Y", url = "Invasion"},
   {id = 420, foil = "Y", url = "Prophecy"},
   {id = 415, foil = "N", url = "Starter 2000"},   
   {id = 410, foil = "Y", url = "Nemesis"},
   {id = 405, foil = "Y", url = "Battle Royale Box Set"},
   {id = 400, foil = "Y", url = "Mercadian Masques"},
   {id = 390, foil = "N", url = "Starter 1999"},
   {id = 380, foil = "N", url = "Portal Three Kingdoms"},   
   {id = 370, foil = "Y", url = "Urza's Destiny"},
   {id = 360, foil = "Y", url = "Classic Sixth Edition"},
   {id = 350, foil = "Y", url = "Urza's Legacy"},
   {id = 330, foil = "Y", url = "Urza's Saga"},
   {id = 320, foil = "N", url = "Unglued"},
   {id = 310, foil = "N", url = "Portal Second Age"},   
   {id = 300, foil = "N", url = "Exodus"},
   {id = 290, foil = "N", url = "Stronghold"},
   {id = 280, foil = "N", url = "Tempest"},
   {id = 270, foil = "N", url = "Weatherlight"},
   {id = 260, foil = "N", url = "Portal"},
   {id = 250, foil = "N", url = "Fifth Edition"},
   {id = 240, foil = "N", url = "Visions"},
   {id = 230, foil = "N", url = "Mirage"},
   {id = 220, foil = "N", url = "Alliances"},
   {id = 210, foil = "N", url = "Homelands"},
   {id = 200, foil = "N", url = "Chronicles"},
   {id = 190, foil = "N", url = "Ice Age"},
   {id = 180, foil = "N", url = "Fourth Edition"},
   {id = 170, foil = "N", url = "Fallen Empires"},
   {id = 160, foil = "N", url = "The Dark"},
   {id = 150, foil = "N", url = "Legends"},
   {id = 140, foil = "N", url = "Revised Edition"},
   {id = 130, foil = "N", url = "Antiquities"},
   {id = 120, foil = "N", url = "Arabian Nights"},
   {id = 110, foil = "N", url = "Unlimited Edition"},
   {id = 100, foil = "N", url = "Beta Edition"},
   {id =  90, foil = "N", url = "Alpha Edition"},
   {id =  70, foil = "N", url = "Vanguard"},
   {id =  40, foil = "O", url = "Arena Promos"},
   {id =  30, foil = "O", url = "FNM Promos"},
   {id =  26, foil = "O", url = "Game Day Promos"},
   {id =  25, foil = "O", url = "Judge Promos"},
   {id =  24, foil = "O", url = "Champs Promos"},
   {id =  23, foil = "O", url = "Gateway Promos"},
   {id =  22, foil = "O", url = "Prerelease Cards"},
   {id =  21, foil = "O", url = "Launch Party Cards"},
   {id =  20, foil = "O", url = "Magic Player Rewards"}
}

Re: Pricing (Scripts and Notes)

PostPosted: 07 Feb 2013, 23:07
by LordHelmchen
Golob wrote:I managed to prepare the avsets table for this:
As it stands, the "foil" field does not really do anything, since the site does not give foil prices :)
edit: also, the spaces needed to be replaced by "%20" for the urls to work.
Golob wrote: would anyone mind spending half an hour of their time to add a pricing script for this site?
It was a bit more, but most of it was generalization of the library 8) The script itself turned out to be nicely simple.
Anyways, take a look at LHpi.tcgplayerPriceGuide-v2.0.lua. Yet mostly untested though. MA shows 302 cards without price in core and expansion after running it.

Re: Pricing (Scripts and Notes)

PostPosted: 24 Sep 2013, 12:35
by LordHelmchen
Recently, mtgmintcards.com received a new search script. The old one
Code: Select all
www.mtgmintcard.com/mtg[c]_search_result.php?search_result=NUMBER&edition=SETNAME&mode=[Foils|Regular]
is still reachable, but might be deprecated in favor of the new one
Code: Select all
www.mtgmintcard.com/magic-the-gathering/[english|chinese]-[foil|regular]/SETNAME&page_show=NUMBER
. The problem is that ?search_result=NUMBER is not used by the site, and the new &page_show=NUMBER seems to be capped at 200 (and defaults to 20, so at the moment the script that's included in MA does not work!) , which obviously is too low to fetch the whole set in one page for further parsing.
How close is the cooperation between slightlymagic.net and mtgmintcards.com? Can someone who is responsible for the cooperation ask mtgmintcards to change their script so that &page_show=NUMBER will accept 500 again ? (and, maybe, while they're at it, ask for it to have ?currency_reference=EUR return data when fetched via lua?)

Re: Pricing (Scripts and Notes)

PostPosted: 24 Sep 2013, 15:40
by Goblin Hero
LordHelmchen wrote:Can someone who is responsible for the cooperation ask mtgmintcards to change their script so that &page_show=NUMBER will accept 500 again ?
It will be simpler to update the lua script.

Re: Pricing (Scripts and Notes)

PostPosted: 24 Sep 2013, 17:12
by LordHelmchen
That may be true for the example script...
looks like I'll have to redesign the url-handling for LHpi, then.

Re: Pricing (Scripts and Notes)

PostPosted: 07 Oct 2013, 11:22
by sho
Hello, I am assessing Magic Album for my personal use and price import is one of the key features I am looking for. As I am a c/p programmer at best I need your assistance on adapting the base Lua script for use with mtgprice dot c o m . I have had some success so far, but the pattern matching is stumping me at the moment. What I have so far only matches every other card (2nd, 4th, 6th etc).
Example URL:
As a new user I am not allowed to post URLs, but to get there go to mtgprice dot c o m, "Browse Sets" and Theros

Import code:
Code: Select all
for name, price in string.gmatch(htmldata, "href =\"/sets/.-\"[^>]+>([^<]+)<.->$([%d.,]+)") do

Re: Pricing (Scripts and Notes)

PostPosted: 07 Oct 2013, 13:25
by LordHelmchen
sho wrote:What I have so far only matches every other card (2nd, 4th, 6th etc).
Import code:
Code: Select all
for name, price in string.gmatch(htmldata, "href =\"/sets/.-\"[^>]+>([^<]+)<.->$([%d.,]+)") do
Code: Select all
<tr><td><a href ="/sets/Theros_(Foil)/Abhorrent_Overlord">Abhorrent Overlord</a> </td><td>$1.12</td></tr><tr><td><a href ="/sets/Theros_(Foil)/Agent_of_Horizons">Agent of Horizons</a> </td><td>$0.5</td></tr>
not checked completely, but at first glance, your regex is not looking for the closing > after the " in the anchor tag.
(hopefully final)Edit: I'd try:
Code: Select all
for name,price in string.gmatch( htmldata, '<a href[^>]->([^<])<.->$([$d.,]+)' ) do
or even
Code: Select all
for name,price in string.gmatch( htmldata, '<a href="/sets/.-">([^<]-)</a>%s*%b<>%b<>$([$d.,]+)%b<>%b<>' ) do

Re: Pricing (Scripts and Notes)

PostPosted: 07 Oct 2013, 14:11
by sho
Unfortunately neither seem to return any prices for me.
Note that I simply tried to alter the mtgmint regexp to match a different "header".

Code: Select all
for name, price in string.gmatch(htmldata, "class=\"cardBorderBlack\".-<a[^>]+>([^<]+)<.->$([%d.,]+)") do
to
Code: Select all
for name, price in string.gmatch(htmldata, "href =\"/sets/.-\"[^>]+>([^<]+)<.->$([%d.,]+)") do
class="cardBorderBlack" /></a></td><td ><a class="opacityit" href="somehtml">Abhorrent Overlord</a>
vs
href ="/sets/Theros/Abhorrent_Overlord">Abhorrent Overlord</a>

I am probably determining the start of the string incorrectly (Likely I am skipping every other " that I am trying to use to signify the beginning of the string).

Re: Pricing (Scripts and Notes)

PostPosted: 06 Mar 2014, 02:33
by LordHelmchen
sho wrote:Unfortunately neither seem to return any prices for me.
Note that I simply tried to alter the mtgmint regexp to match a different "header".
...
It seems I completely forgot about you... I found this lying around and just updated it to the latest library specifications. It still needs a lot of namereplacement work, but you may find it useful. In case you want to finish it, check the wiki.
current state is:
Total counted : 17216 set, 221 failed English cards ; 0 dropped, 40 namereplaced and 0 foiltweaked.
Total expected: 18408 set, 0 failed English cards ; 0 dropped, 20 namereplaced and 0 foiltweaked.

Re: Pricing (Scripts and Notes)

PostPosted: 05 Jul 2014, 20:10
by Serenus
Hey, this is my first time posting on this forum, and I didn't read all of the posts preceding mine--forgive me if this is something that's already been taken care of.

I noticed that the "MTG Mint Card.lua" file included with Magic Album is out of date with respect to the mtgmintcard website. It looks like the URL structure was changed, so I updated the URL construction and respective set names to reflect the new structure. The issue wasn't immediately obvious, as if you browse to the old constructed URLs you can still see the correct page in a browser. However, the HTML page that was being returned to the LUA code by the old URLs was a 301 with a redirect, so no pricing data was coming in. I've attached my updated file for community use and inclusion in future packages if desired.

Edit: sped up the price get a bit.

Re: Pricing (Scripts and Notes)

PostPosted: 30 Aug 2017, 17:19
by NebuKadnezar
Hi there,
I just startet to use Magic Album and like it a lot. I struggle with implementing the pricescripts. Are they still working or is this a outdated project?
Greetings Nebu

Re: Pricing (Scripts and Notes)

PostPosted: 30 Aug 2017, 19:54
by Goblin Hero
NebuKadnezar wrote:Are they still working or is this a outdated project?
MtgMindCard bundled with MA should work. Scripts in this topic are most likely outdated, but you can use them as an examples to write your own ones.

Re: Pricing (Scripts and Notes)

PostPosted: 30 Aug 2017, 20:05
by NebuKadnezar
Thanks for your reply. I am not into programming, so I will not write my own scripts :) But I managed to implement MTGMint. Is there an option to get the english prices for my german cards?

Re: Pricing (Scripts and Notes)

PostPosted: 30 Aug 2017, 20:20
by Goblin Hero
NebuKadnezar wrote:Is there an option to get the english prices for my german cards?
Yes, there's a checkbox "Apply prices to all langs" in the price manager window.