Comments (18)
Hello,
I started to implement the price data fetching from MKM but it seems to use specific ids for identifying cards. I think that adding them to the bdd would be a good idea, but it is also possible to get the price by the name and set. However this latter solution require to search among all cards that have the same name, therefore that can be longer for cards with many reprints. In addition, a request can't return more than 100 cards, then it can require more than one request for cards like basic lands.
I didn't find many information about the card database. I thought about adding a new column to the cards table, and modifying every "patch" file. About those files, do you have some tools to edit them easily?
Also for now I don't know how to to browse MKM marketplace without an acount, I'm waiting for a response from them. It's likely that it will not be possible until the API v1.1 then I asked them if it was ok to create a dummy account for the application, I'm still waiting for a response.
from mtg-familiar.
Price lookups through the TCGPlayer API are already done by name and set, and basic land lookups aren't any slower than other searches. With a set + name search, at most four basic lands would be returned, far short of 100. Where would you get the MKM ids anyway?
I am generally averse to adding columns to the database. Not that it can't be done, it's just a hassle. I have a tool to make new patch files, but it's not checked into GitHub. I should fix that.
After reading some documentation, waiting for v1.1 of the API with widget applications, seems like the best way of going about things, for now.
from mtg-familiar.
With a set + name search, at most four basic lands would be returned, far short of 100.
I didn't explained correctly, sorry. It's not possible to make a request with name and set. You can only give name, and the response contain information about every cards with this name in a XML form, including their set and productId. You have then to look through this XML to find the entry that match with your set name. It is documented here : https://www.mkmapi.eu/ws/documentation/API_1.0:Products (please take a look at the example at the end) and it's the same in the v1.1.
Then you can only request for example for "Forest" and it give you a response composed of an entry by forest by set containing one (about 450 cards so 5 requests). Not that the cards are actually sorted by set, and the most recent set are the lasts.
The other way to get product information is by the ProductId. I already wrote a script that get the productId given a card name and a set. Stocking those Id in the db allow to make all those search
a priori and access very quickly to the card in the app. However, for most card the search process will be very short so both solution are OK I think. I personally prefer the DB one because I reduce the need to network bandwidth and is IMO more elegant, but please tell me what you prefer.
I have a tool to make new patch files, but it's not checked into GitHub. I should fix that.
Thank you :)
After reading some documentation, waiting for v1.1 of the API with widget applications, seems like the best way of going about things, for now.
Yes, i'll just work with my account for finishing the implementation and I'll make the pull request when the v1.1 version will be fully available. (Please don't hesitate to tell me if my code is bad, event if the amount of code to actually write is small)
from mtg-familiar.
Ah, I understand now, I find it a shortcoming that you can only search by name and not name+set. If you ever get a response from them, you should propose a name+set search.
A good middle ground for product IDs would be to build the script into the app, and then save the ID into the database so that it doesn't have to be recalculated each time. How does your script work anyway?
And don't worry, I'll check your code :)
from mtg-familiar.
I received a response yesterday about the API. The "widget app" will be available both for the v1.0 and v1.1 which change only by using OAuth instead of an apikey. It will be deployed on the beta test server this week, but there is no date for the deployment on the real server.
My scripts does request with the name of the card and search through all the version of this card the one with the good set. I began to modify all the patches too add the id (that also allowed me to see how MKM handle special names, split cards, etc., which is not precised in the documentation) and it appears that only one request is needed for every cards but basic lands so yes we can insert the ids in the db in a lazy way (or I could finish to modify the patches but the "upToM14" one seems to fail, maybe I make too much request in a row). It also showed me that some special cards like plans from planshase 2012 are associated with a special set that is not Planeshase 2012, and it seems that it doesn't work with TCGplayer with the current code either (try for example to add "Stairs to Infinity" to your whishlist).
Another concern is that there are and there will be some duplicated code for currency management and price engine option between the Trade fragment and the Wishlist fragment (for example for price option you used translated string in the trade fragment but not in the whishlist fragment). I thought about an abstract class for example "PriceFragment" that could be a parent class of TradeFragment and WishlistFragment and would manage the price engine and currency work but maybe it is not desirable to have too many inheritance.
from mtg-familiar.
I think we'll have to add some fields to the PriceInfo class, and then add the MKM code to loadDataFromNetwork() in the PriceFetchRequest class. There shouldn't be much duplicated code there, although someone will have to change the preference to add MKM to the current list of TCGPlayer Hi/Med/Low/Foil.
"Stairs to Infinity" does not appear to exist on TCGPlayer.com, which is likely the problem there. We can only be as good as our data sources, not better. Is it possible to do multiple queries for basic land prices, and then cache the ID? I would still be happy with a slow initial lookup and a fast one afterwards.
If you look in the database table for card sets, there is a column for TCGPlayer.com names, since they can differ for old sets ("Alpha Edition" for TCGPlayer.com, "Limited Edition Alpha" on Gatherer). Will we need another column for MKM name?
from mtg-familiar.
I think we'll have to add some fields to the PriceInfo class, and then add the MKM code to loadDataFromNetwork() in the PriceFetchRequest class. There shouldn't be much duplicated code there, although someone will have to change the preference to add MKM to the current list of TCGPlayer Hi/Med/Low/Foil.
In the code I pushed I added the currency management to the Tradefragment but yeah it could be better to move everything in the PriceInfo objetcs. MKM does not provide High price so I removed it from the choices when MKM is chosen (still in the code I pushed).
Is it possible to do multiple queries for basic land prices, and then cache the ID? I would still be happy with a slow initial lookup and a fast one afterwards.
If you look in the database table for card sets, there is a column for TCGPlayer.com names, since they can differ for old sets ("Alpha Edition" for TCGPlayer.com, "Limited Edition Alpha" on Gatherer). Will we need another column for MKM name?
I already have a PriceFetchRequest that almost work (still some problem with certain cards) with MKM, the set name used are the fullname that is in the database so we won't need other column.
from mtg-familiar.
Sounds good. I'll take a peek at your fork later.
from mtg-familiar.
Hello,
I'm still implementing the feature of adding the mkmid after the first request (note that the rest is pushed, the tests are done from my account so I removed my apikey from the sources). I didn't have a lot of time these days but MKM seems to take time to deploy their API also :p. Unfortunately, I discovered that some set names in the database don't match with the set names used by MKM. I'll make a full comparison, and if it's only some set I can hardcode the transformation (for example it seems that for core set I only have to remove "core set" from the name stored in the database). If there are to many differences in names i'll add a column in the database (something like "MKM set name"). You wrote the comment "why can't everything be consistent?", I can't agree more :p
EDIT: done : http://pastebin.com/5JAFDf1z So there are 16 set that are not consistent with MKM on 122 stored in the database (there are a lot more in MKM but most of them are non-relevant). Don't know if it deserve a new column in the database. I admit that the idea to modify every patch seems boring (althought it should be quite fast now that I have python script to manage them).
from mtg-familiar.
HI
I was very busy thoses days, but now I have time and I pushed a version that fetch price as a widget app from the version 1.1 of the API. I used signpost library to manage the OAuth part, since it's very lightweight and already used in some android applications. I had to slightly modify the signing part however, because normal OAuth provider seems to require a percent-encoded signature and MKM don't. This is the reason of the new class. For now the request is on the beta test server of MKM.
I still need to care of the few different set names between the database and MKM, so if I add a field in the set table (like "mkm_setname") I need to modify all the patches. While I have some python script that could do that, maybe it would be better to modify the tools you use for building patches?
from mtg-familiar.
We're all pretty busy these days. I'm a little ashamed to admit, but I still build the TCG names patch file by hand. I believe we'll have to add a similar file for MKM names. If you have a python script to generate it, we'll use that.
Separately, I did start making a tool to generate patches, but I was sidetracked before I finished. One day.
from mtg-familiar.
My patch building tool is nearing completion. Do you have a list of MKM names which I can put into the config file?
from mtg-familiar.
I received a notification about a CSV, but don't see it posted here. Can you upload it again?
from mtg-familiar.
Yes it seems it's impossible to attach a CSV so I sended an email but it seems the adress was wrong, sorry. So here http://pastebin.com/SRYEdQ2J is the correspondance between MTGFamiliar database setnames and MKM setnames in CSV (id,code,MTGFname,MKMname). And here http://pastebin.com/8B9j6Zvp is the complete MKM setnames list, which is larger.
Brice
from mtg-familiar.
The full MKM setname list includes cards which are not listed on Gatherer. I plugged those values into my patch generator, and you can find the result here: mkmnames.json. It'll have to be processed similarly to how TCGnames.json is processed.
from mtg-familiar.
Has there been any more work done on this? I was trying to trade cards earlier and MKM is terrible on mobile. I can't seem to find any options to enable on mtg familliar. I was about to start my own when i stumbled across this thread.
from mtg-familiar.
I haven't done any work on it, and it looks like bberna's fork hasn't been touched since last July. You are more than welcome to give it a shot, and I'll help if you need. I'd recommend forking from master, not bberna's attempt, as a starting point.
from mtg-familiar.
New documentation URL: https://api.cardmarket.com/ws/documentation
from mtg-familiar.
Related Issues (20)
- Java cert error on card ruilings HOT 1
- Adding market price to cached data HOT 3
- Create image for UNF Ticket
- Crash on latest beta from Google play store HOT 1
- Sort Trades and Decks Alphabetically HOT 1
- Reserved List Functionality Regressions HOT 1
- Properly Exclude Sets when Querying
- Banned cards show when filtered by format HOT 1
- Unable to save image, try again later. HOT 26
- Search is blocked while database updates are queried HOT 4
- Maybeboard in deck build section. HOT 1
- Dual face cards have "a" and "b" in their collector's number internally even though these are not physically on the cards HOT 1
- Battles do not display their starting defense HOT 1
- Feature Request: Add effective date of Rules to a prominent location HOT 1
- Rulings no longer work HOT 1
- Current IPG doesn't appear in Judge's Corner HOT 1
- Exact text search. HOT 2
- Card database updates completely whenever a new set releases HOT 3
- When the update window is on front, it becomes invisible if phone goes into sleep and out of sleep HOT 1
- Second progress bar from the database update can be misleading because full when it shouldn't
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtg-familiar.