Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poeapp.com as an option #429

Closed
Pegoth opened this issue Aug 13, 2017 · 10 comments
Closed

Add poeapp.com as an option #429

Pegoth opened this issue Aug 13, 2017 · 10 comments

Comments

@Pegoth
Copy link

Pegoth commented Aug 13, 2017

Trade macro should (if possible) use poeapp.com too for faster search, because right now poe.trade is pretty much useless in-game in the weekends. You have to wait like 10 or more seconds for a qick price check.

@Eruyome
Copy link
Collaborator

Eruyome commented Aug 14, 2017

"If possible" being the issue here. It's certainly not impossible but it requires huge amounts of work and time. So for now you shouldn't expect it. I agree though that it would be nice to have.

@SabreCat
Copy link

I would love to see this!

@Eruyome
Copy link
Collaborator

Eruyome commented Aug 28, 2017

Can't find my own quote so I'll make it short. I talked to the poeapp guy, I'll probably add some support in the near future since it may not as much work as I thought BUT it will only be support to open searches on the website, no tooltip results. This is also a request from the poeapp dev since he can't handle those requests yet (no browser page visit -> no ad revenues).

@Wires77
Copy link

Wires77 commented Jun 7, 2018

Just to chime in here, pathofexile.com/trade is a good addition as well. I might look through the code and see if I can make a fork for it.

@Eruyome
Copy link
Collaborator

Eruyome commented Jun 8, 2018

I know but a proper implementation will be a shit ton of work and reworking existing code. The macro is tailored to poe.trade, written and extended over a long period of time without any prior design documents/planning. There is a lot of functionality that would need to be refactored into functions that work independently of the the used trade site, into functions that can handle all the differences between them...

Adding support for more trading sites will be a big project, I won't accept some half-assed hacky solutions.
Also, it would be a time to decide whether to actually support multiple sites or to completely switch to the official site only. But there's a lot to consider. It's rather easy to collaborate with third party sites, talk about upcoming features, suggest features and options, ask for certain functions or API endpoints to make developing TradeMacro easier. I can't expect to work together with GGG and get any answer or fast answer to certain questions I might have.

Aside from that, third party sites can be better in certain aspects, especially poeapp.com is always under heavy development, always adding new features, options and pseudo mods. From the top of my head I'm thinking of stuff like (total) life + mana.

@Wires77
Copy link

Wires77 commented Jun 8, 2018

Oh neat, I wasn't aware of the added pseudo mods (that one would be really nice for my MoM/guardian builds).

Yeah, I noticed there is a lot of manual parsing that has to happen to get the tooltip to work, but changing the json to work with different sites (as you said above to get opening on the website to work) might be a good goal to start with. If I end up working on a fork, I'll make sure to abstract as much as I can.

@Eruyome
Copy link
Collaborator

Eruyome commented Jun 8, 2018

Well... there are certain steps:

  • Make sure the user can connect to the trade site and try to solve possible issues (cookies and cloudflare for example).
  • Download certain data from the used trade site (available form options like item types, bases, gems etc).
  • Download/prepare a file with all mods supported on the trade site (currently I'm doing this with nodeJS for poe.trade since it's easier to parse the downloaded html and export as json and it's not neccessary to do it on every script start. Seperate project, I just add the prepared data files.
  • Compare the available leagues from the APi with the ones currently selectable on the trade site, add the ones from the trade site that aren't listed on the API (at least that was used in the past with some race events).
  • Prepare the urls/post requests for every search, tailored to the trade site, every little form option has its own parameter which is different for every site, then there are mod groups too. Take a look at class RequestParams_, class _ParamModGroup, class _ParamMod in TradeMacro.ahk.
  • When using the advanced search create pseudo mods for the item, which would be different for every site, take a look at CreatePseudoMods(mods, returnAllMods := False) in PoE-ItemInfo.ahk.
  • Parse the returned search results. Which is currently the html source code of poe.trade and would be JSON on the official page but I believe you need to make 2 different requests to actually get them and I'm not sure about poeapp.

I probably forgot some stuff.
Simply opening on the website also requires to create the pseudo mods and request params/url/available form options etc.

@piazzacarmelo
Copy link

piazzacarmelo commented Jun 12, 2018

this can be a good challenge to improve my code knowledge. I'm looking at your code in my free time, but i don't see any ggg api documentation anywhere. Can you link me where can i find info? trade api are based from http://www.pathofexile.com/api/public-stash-tabs right?

EDIT: found it

@Eruyome
Copy link
Collaborator

Eruyome commented Jun 12, 2018

If you really want to contribute and start this implementation off I suggest the following.
Take a look at some important parts that I don't have to touch at all at the moment:

  • PoE-ItemInfo.ahk: CreatePseudoMods(mods, returnAllMods := False) {
    • This creates all pseudo mods, some only used for ItemInfos tooltip and others that are also or only used for TradeMacros advanced search.
    • This function can be rewritten to create pseudo mods depending on the selected trade site (which can be hardcoded while implementing this).
  • TradeMacro.ahk: TradeFunc_Main(......:
    • There's a lot going on here:
      • RequestParams := new RequestParams_()
      • RequestParams.league := LeagueName
      • All these uses of the RequestParams class need to be wrapped in some function call like AddReqParam(paramName, paramValue), where a global selectedTradeSite is used to create these parameters and later on a valid url from these parameters.
    • TradeFunc_GetItemsPoeTradeMods and TradeFunc_FindInModGroup() are used to check whether a mod exists on the trade site and creates a param variable which contains the valid name that the mod has on the trade site.

All of that could be rewritten independently of each other and is pretty modular. If you start to randomly make all kinds of changes I'm not sure whether I want to implement those changes but these modular things can be tested and replaced rather easily.

@thirdy
Copy link
Collaborator

thirdy commented Jun 14, 2018

Got a copy of the initial version of TradeMacro when it was just for price checking:
https://github.com/thirdy/proto-trademacro
Could be a good start to prototype/proof-of-concept/test making TradeMacro to work with GGGTrade.

@Eruyome Eruyome closed this as completed Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants