Thread Tools Display Modes
07/08/20, 12:30 PM   #1
mikra
Join Date: Sep 2018
Posts: 5
Question 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?
  Reply With Quote
07/08/20, 12:39 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
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).
  Reply With Quote
07/08/20, 12:41 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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.

Last edited by Baertram : 07/08/20 at 12:44 PM.
  Reply With Quote
07/08/20, 12:55 PM   #4
mikra
Join Date: Sep 2018
Posts: 5
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?
  Reply With Quote
07/08/20, 01:16 PM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Did you check the TTC addon? It sounds like something it should be able to do?
  Reply With Quote
07/08/20, 02:13 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Originally Posted by mikra View Post
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?
  Reply With Quote
07/08/20, 10:54 PM   #7
mikra
Join Date: Sep 2018
Posts: 5
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?
  Reply With Quote
07/09/20, 01:12 AM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
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.
  Reply With Quote
07/09/20, 09:00 PM   #9
wambo
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 38
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
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » search item in browser

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off