It is currently 01 May 2025, 01:06
   
Text Size

Magic Album - Feature Requests

need to set http(s) authorization header in ma.GetUrl (or similar) (new)

 

Greetings again!
The site https://www.magiccardmarket.eu/, a market place for both commercial and private sellers, is quickly becoming the de-facto standard way to buy and sell magic cards in europe, cutting out the middlemen.
As it is almost the only relevant source of prices for me (even card-for-card trades at my local game shop are checked against "lowest price from an established (=more than 5 sells) seller from our country"), I once again tried to write an LHpi sitescript for it. They offer an [url]API[/url] to access their site that could be used to receive pricing (https://www.mkmapi.eu/ws/documentation/API_1.1:Market_Place_Information). For that I need to implement basic OAuth (https://www.mkmapi.eu/ws/documentation/API:Auth_Overview), and there's currently two puzzle parts missing from MA's api:
1) I need to get os.time() to get unix time and nonce to construct the authorization.
2) I will have to send https GET requests with an Authorization header. My attempts at finding a working version of luasockets dlls for lua52 were unsuccessful so far. As you already have ma.GetUrl in the API, I hope however you implemented it would allow to expose enough to add the Header to the request...

As they offer multiple prices
    SELL (Average price of articles ever sold of this product)
    LOW (Current lowest non-foil price (all conditions) )
    LOWEX+ (Current lowest non-foil price (condition EX and better) )
    LOWFOIL (Current lowest foil price)
    AVG (Current average non-foil price of all available articles of this product)
this script could also profit from my FilenameOption proposal: with the price type and offline mode set through the filename, multiple price versions could be imported with only one query to their server.

Of course, if the only reason you delegated pricing to external scripts was the volatility of html-scraping, you might be persuaded to add a real magiccardmarket client to Magic Album. Interesting ways to use it include:
-having more than just one price column available in the grid, to see LOW and AVG at the same time.
-Creating an inventory and uploading it to sell cards.
-Building a Wanted list from the difference between a deck and the inventory.

If there's any more information you need or any help I can offer, please ask.

Comments

Posted by LordHelmchen » 04 Nov 2014, 11:30

Trying this from my end, I have been able to aquire working luasockets by installing mingw and luarocks (at least the require imports go through).
Current roadblock is luasec: though it built fine with luarocks, the rockspec from moteus's comment at https://github.com/brunoos/luasec/pull/26 and OPENSSL_DIR=C:\OpenSSL-Win32 installed from http://slproweb.com/products/Win32OpenSSL.html, the resulting ssl.dll results in
Code: Select all
C:\lua\lua52.exe: error loading module 'ssl.core' from file 'D:\Magic - The Gathering\LHpi.git\LHpi\src\lib\bin\ssl.dll':
   %1 ist keine zulässige Win32-Anwendung.
(not a valid win32 application).
luasec rock apparently only produced ssl.lua, ssl/https.lua and ssl.dll...

Posted by LordHelmchen » 07 Nov 2014, 21:59

I resolved the dll troubles, semi-PEBKAC, I have to admit.

Although in the long term, ma-approved dlls would probably be nice, for now I can do with external imports.
Auth header looks to be constructed ok, but something's still wrong with the final request... I'll continue to look into it.
You could probably decrease this request's priority :)

Posted by LordHelmchen » 12 Nov 2014, 02:30

Greetings again!

The script is progressing nicely, and though lots of setname and cardname mappings still need to be done and comments and documentatin is not done yet, the import mostly works in my development dummy.
There's a few external dependencies, though, and for that I need to set package.path, package.cpath and the require function to be accessible from the builtin lua interpreter, as well as os.time() (and probably a few more that are needed from within the external libraries, but that needs to be tested).

Attached is the current alpha "build", with all dependencies. three dlls in lib\bin (libeay32.dll,ssleay32.dll,ws2_32.dll) probably need to be in the same location as the lua52.dll, the rest should work where they are. run lib/dummy as lua application or select magickartenmarkt.lua from Magic Album Price Managment. As this is still largely unpolished and gpl and MIT licence notes are still missing, please delete the attachment from here once you downloaded it.
Last edited by LordHelmchen on 13 Jul 2015, 12:31, edited 1 time in total.
Reason: removed attachment

Posted by LordHelmchen » 13 Jul 2015, 12:35

The attachment has been downloaded 29 time, and I assume if Goblin Hero wanted to look at it, he is one of those 29. As this version never was in a releaseable state and has ceased to be functional due to mkm api changes, I think it's better to remove it.

I'm still trying to work around the restrictions set by MA and MKM to make this work, albeit slowly. As of 2015-07-10, I have (again) successfully imported Theros Block prices, but it is still far from adhering to the usability and quality standard I set for myself.

Posted by LordHelmchen » 14 Oct 2015, 12:49

LHpi.magickartenmarkt has been released.
For now, it uses an mkm-helper script that runs outside of MA to download price data from mkm.
Release info in thread and wiki.

If there's a chance to have them added, I'd go over the current version and compile a list of all functions and dlls that an integrated mkm downloader would need to work from within the embedded lua interpreter.
Otherwise the external download helper is a servicable workaround, and you can probably close this as WONTFIX :-)

Ticket details

  • Ticket ID: 488
  • Project: Magic Album
  • Status: New
  • Component: Pricing
  • Project version: (unknown)
  • Priority: Normal
  • Assigned to: (unassigned)
  • Reported by: LordHelmchen
  • Reporter's tickets: List all tickets
  • Reported on: 31 Oct 2014, 11:24
  • Last visited by Goblin Hero » 05 Dec 2018, 08:08.
 

Login Form