ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   search item in browser (https://www.esoui.com/forums/showthread.php?t=9262)

mikra 07/08/20 12:30 PM

search item in browser
 
Is it possible to add a context menu entry for items in inventory/bank/boxes to send the item name (and maybe properties) to the browser to search in the internet for it?

sirinsidiator 07/08/20 12:39 PM

Technically yes, but unless you have some specific website in mind, it will most likely not give you the result you want (e.g. searching for "Worms" on google won't give results related to the bait item in eso).

Baertram 07/08/20 12:41 PM

To search for prices on e.g. Tamriel trade Center e.g. you'd need the name and other data which have to be put into an URL that thie website can interprete, so you need to check which website got what URL and get parameter to use for such kind of searches.

e.g.
Tamriel trade Center, Englisch language, EU server, "Bowl of worms" name of item ->
Code:

https://eu.tamrieltradecentre.com/pc/Trade/SearchResult?SearchType=Sell&ItemNamePattern=Bowl+of+Worms&ItemCategory1ID=&ItemTraitID=&ItemQualityID=&IsChampionPoint=false&LevelMin=&LevelMax=&MasterWritVoucherMin=&MasterWritVoucherMax=&AmountMin=&AmountMax=&PriceMin=&PriceMax=
You could add other serach parameters after each of the =, like level, quality etc. and just need to map the internal ESO values to the needed website Get parameter values in order to make it work.

BUT: I'm not sure what's the MAXIMUM lenght of the ESO website open URL popup! So keep in mind you cannot just put there a 10000 characters
long link e.g.

mikra 07/08/20 12:55 PM

Thats what I had in mind :)
I would like to search the item on Tamriel Trade Center by
- Name
- Level (160)
- trait
sorted by price (lowest first)

This would be an example for Inferno Staff of a Mother's Sorrow, 160, precise.

Code:

https://eu.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=10297&SearchType=Sell&ItemNamePattern=Inferno+Staff+of+a+Mother%27s+Sorrow&ItemCategory1ID=&ItemTraitID=2&ItemQualityID=&IsChampionPoint=false&LevelMin=160&LevelMax=&MasterWritVoucherMin=&MasterWritVoucherMax=&AmountMin=&AmountMax=&PriceMin=&PriceMax=&SortBy=Price&Order=asc&lang=de-DE
Has noone done that before?

sirinsidiator 07/08/20 01:16 PM

Did you check the TTC addon? It sounds like something it should be able to do?

Baertram 07/08/20 02:13 PM

Quote:

Originally Posted by mikra (Post 41747)
Thats what I had in mind :)

Has noone done that before?

No as there exists an addon which does the same for you ingame?
No need to check the prices via a small popup dialog showing you the TOTAL length of the URL like
https://eu.tamrieltradecentre.com/pc...asc&lang=de-DE
-> And not even sure if it would be able to accept this total length of the string...

How to do such an addon:
You can build such an addon by just using LibCustomMenu to add a context menu entry to the inventory items,
let a function parse the item at the slot you are using the context menu on, using API function like local name = GetItemName(bag, slotIndex) and then parse the name:
-strip stuff like gender ^m ^s ^np via local nameClean = ZO_CachedStrFormat("<<c:1>>", name) (French, German and maybe other languages contain these characters as asuffix to the name!)
-replace spaces and other special characters with URL conform "ESCAPED" values like %27 for the ' in Mother's and + for a space
and store it in variable lcoal itemNameCleanAndEscaped
-get the client language and create a TTC compatible variable for the URL

local TTClang = "en-EN" --Fallback language English
local clientLang = GetCVar("language.2")
if clientLang == "de" then
TTClang = "de-DE"
elseif clientLang == "fr" then
TTClang = "fr-FR"
end

-And then use string.format to replace the placeholders in your defined URL template for TTC, e.g.
local templateTTCEUItemSearch = "https://eu.tamrieltradecentre.com/pc/Trade/SearchResult?SearchType=Sell&ItemNamePattern=%s&lang=%s
> I've shortened the URL. It seems to work witrh the search as well.
You only need the other stuff like
Code:

&ItemCategory1ID=&ItemTraitID=2&ItemQualityID=&IsChampionPoint=false&LevelMin=160&LevelMax=&MasterWritVoucherMin=&MasterWritVoucherMax=&AmountMin=&AmountMax=&PriceMin=&PriceMax=&SortBy=Price&Order=asc
if you want to add the item level, quality, trait and other values to your search.

local urlToCall = string.format(templateTTCEUItemSearch, itemNameCleanAndEscaped, TTClang )

And then call it via the API function to open a HTTP request via RequestOpenUnsafeUrl(urlToCall)


But again:
This is ALL in the given addon Tamriel Trade Center so why would one create another addon for it?

mikra 07/08/20 10:54 PM

prices in TTC addon are often outdated (even more than on the site) and lowest price often only shows an extreme outlier price. I would like to browse the current listings to judge the price levels better.

If it could be done, regarding the length of the url, how much may it cost, if someone would do it for me?

sirinsidiator 07/09/20 01:12 AM

Did you ask the author of the TTC addon if he wants to add this as a feature? If not I suggest you start there - it's his project after all and you should donate there before asking other authors if they want to write another addon for money. :rolleyes:

wambo 07/09/20 09:00 PM

I think the prices in the addon are synced up with the website? Do you keep the client running?

But I'd also find it useful if you want to buy an item, to get a link to a list on the website, so you can check the shops. Maybe a prefilled search request, so you could still change for example "trait" to "any"

But yes, I'd also try with the TTC author first :D


All times are GMT -6. The time now is 07:16 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI