exile-center / better-trading

QoL improvements for the official PathOfExile trading site.
30 stars 5 forks source link

[Request] Save the URL Query instead of just the search ID #131

Closed Srlimao closed 8 months ago

Srlimao commented 9 months ago

Is it possible to save the search URL with the query instead of just the search ID? so its not league dependent Like this Instead of this

pboutin commented 9 months ago

The search ID is not league dependent. If you change the "active" league on the trade site, the bookmarks will start pointing on the active league. (Maybe it changed but since we're in between leagues I can validate for sure)

Srlimao commented 9 months ago

Hm some of my old searches become invalid if I don't use it for some time, I thought saving the query URL it could solve that

dbjorge commented 9 months ago

That's a separate issue; the trade website periodically cleans out old unused search queries on its end. A search that you haven't visited in a long time will become unavailable on the website regardless of whether you save it using the extension or a regular browser bookmark.

Srlimao commented 9 months ago

Understood, and is possible to save the query URL in better trading? I made a small extension to extract that and save in my bookmarks

dbjorge commented 8 months ago

Looking at this again I now see that I misunderstood the original question. What you're asking is whether, rather than storing the query ID pulled out of the trade site url (like QrVX393tw) and having bookmarks navigate to URLs like https://www.pathofexile.com/trade/search/Ancestor/QrVX393tw, we can instead query the internal trade site API on bookmark update (https://www.pathofexile.com/api/trade/search/Ancestor/QrVX393tw) and store the result such that bookmarks navigate to URLs like https://www.pathofexile.com/trade/search/Ancestor?q={"query": { /* JSON description of selected filters */}}.

I agree that you could technically use something like that to enable bookmarks that don't become stale when the original trade queries expire, but we're not going to implement it in Better Trading because it would require making requests to internal website API endpoints (the internal API to grab the query JSON and also the undocumented q= form of the trade site URL), which is expressly forbidden by the Path of Exile developer docs and terms of use.