Git Product home page Git Product logo

Comments (31)

Gasur avatar Gasur commented on July 18, 2024

This wouldn't be very performance friendly either, as it would, once an hour, request all of the prices. Maybe at initial installation, it'll request them all (or if you do not have any in local storage already) & then if the result is (maybe user defined?) over an hour old, then it'll request it again?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Don't think it is that bad. It is only one request per hour to our future JSON API, and it easily allows to have a market price for all items on CSGL without delay. The pros outweigh the cons anyway. At the moment market price loading for inventories takes way too much time too if your inventory is huge (100+ items).

There is already another extension that is doing the same actually, but I believe it is 4 hour interval instead. https://chrome.google.com/webstore/detail/csgoloungecom-prices/hgbdpagnjbkhoadnmjcaainaclkmhfla

from loungedestroyer.

Gasur avatar Gasur commented on July 18, 2024

Hmm, probably true. Just make sure not to get rate-throttled for the initial request.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

You misunderstood and I didn't explain it properly, the JSON API will be LoungeDestroyer's, hosted on my webserver. It will return all CS:GO items market values at once, single request. The application on my server would fetch steam market prices periodically and store in a database, then cache the response for LD users.

from loungedestroyer.

Gasur avatar Gasur commented on July 18, 2024

Ah, that makes more sense. If you put it into one large array, I'm sure you could reduce the bandwidth waste. What about the CPU/sudden BW load on the client side? Would you somehow throttle that, or just let it overload for a few seconds at most?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Bandwidth shouldn't be a concern since it's just a JSON (list of weaponName => marketValue), and not sure about CPU load but it will just save the API response straight away to Chrome Local Storage. Besides I am already doing two other tasks in the background with AJAX requests: 1) New match checking 2) CS:GO Lounge bot status

from loungedestroyer.

Gasur avatar Gasur commented on July 18, 2024

Okay, awesome. Great idea however. Hopefully it'll work out just fine in practice.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Yep, just need to write it. :( Or find already existing solution.

from loungedestroyer.

Gasur avatar Gasur commented on July 18, 2024

Wish I could help, but JS isn't my language :P - Good luck though.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

It doesn't need to be JS since its a server application, it can be PHP if you want.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

http://csgo.steamanalyst.com/jsonList.php Could reuse this on web application.

from loungedestroyer.

Gasur avatar Gasur commented on July 18, 2024

How frequent does this update?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

I do not know, but I asked them on subreddit if they have API. http://www.reddit.com/r/steamanalyst/comments/2h1bvf/api_for_developers/

from loungedestroyer.

birjj avatar birjj commented on July 18, 2024

Possibly save all requested prices to storage, along with timestamp. Then check if item has a price in storage before requesting, and if so, check if timestamp is more than an hour ago. If it is, request new price. Otherwise, load from storage.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Steam API is very poor. I searched for ways to get all marketable items, but I couldn't find a way to get a list of all skins, not even through game files. The classIDs is somewhere located, but I don't know where.

Example API request for an item:
http://api.steampowered.com/ISteamEconomy/GetAssetClassInfo/v0001?key={APIKEY}&format=json&language=en&appid=730&class_count=1&classid0=350539070

After that I figured I could try scraping data from market search instead. Volvo allows to list 100 items per page.

http://steamcommunity.com/market/search/render/?query=&start=0&count=100&search_descriptions=0&sort_column=name&sort_dir=asc&appid=730&currency=1

Currency can be forced if you are not logged in.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Okay, I made some progress, but the market price fetching script needs to be more bullet proof.

from loungedestroyer.

EJanuszewski avatar EJanuszewski commented on July 18, 2024

Is this every single item?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Every item that is on Steam market for CS:GO.

from loungedestroyer.

EJanuszewski avatar EJanuszewski commented on July 18, 2024

Swagilicious

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Okay, I made the script more dirtier by applying dirty error handling and retrying for each request (25 requests in total). If anyone wants to see the script, I have it on private repository.

Now to work on the extension part.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Should we convert the betting value for items too?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Some progress. I love it how it loads market prices in a lightning speed. 😄 Still not ready to be pushed live though.

d324b2f

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Requesting a file is a fucking stupid idea since it comes uncompressed. 250kb (CS:GO only) without gzip compression. 32kb with gzip. Getting rid of quantity property makes it 25kb.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Doto2 + CS:GO = 180kb. Hmpph.

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

Now with Doto2.

from loungedestroyer.

JakeXSV avatar JakeXSV commented on July 18, 2024

Is this still something that needs to be done? I say we get an API repo created, use NodeJS (keep it javascript since all contrib's have used it?), and get it hosted on Heroku (free service).

from loungedestroyer.

Wysywyger avatar Wysywyger commented on July 18, 2024

Apologies for necroing this, I am also looking to write a code that will fetch the market data for all available items.

I have looked at what's available on GitHub but it seems all to fetch the data for single items.
Is there something that does it for all items for a game?

from loungedestroyer.

ncla avatar ncla commented on July 18, 2024

There is no easy way, sadly.

from loungedestroyer.

 avatar commented on July 18, 2024

http://api.steampowered.com/ISteamEconomy/GetAssetClassInfo/v0001?key={APIKEY}&format=json&language=en&appid=730&class_count=1&classid0=350539070

Is there another alternative to get all cs:go weapon skins not ony by one ?

from loungedestroyer.

Andrej730 avatar Andrej730 commented on July 18, 2024

@xscence
All i know - you can take some classids from here

http://api.steampowered.com/ISteamEconomy/GetAssetPrices/v0001?format=json&language=en&appid=730&key={api_key}

and use them like this

http://api.steampowered.com/ISteamEconomy/GetAssetClassInfo/v0001?key={api_key}&format=json&language=en&appid=730&class_count=91%27&classid0=992003612&classid1=992003613&classid2=927007517&classid3=721248158&classid4=638243112&classid5=613589848&classid6=360448780&classid7=259019412&classid8=186150630&classid9=341265706&classid10=191923205&classid11=186150629&classid12=506856209&classid13=506856210&classid14=613589849&classid15=613589850&classid16=613589851&classid17=613589852&classid18=613589853&classid19=613589854&classid20=613589855&classid21=613589856&classid22=613589857&classid23=613589858&classid24=613589859&classid25=613589860&classid26=613589861&classid27=613589862&classid28=613589863&classid29=613589864&classid30=613589865&classid31=613589866&classid32=615451613&classid33=619637866&classid34=619637867&classid35=619637868&classid36=619637869&classid37=619637870&classid38=619637871&classid39=619637872&classid40=619637873&classid41=619637874&classid42=625567400&classid43=625567401&classid44=625567402&classid45=625567403&classid46=625567404&classid47=625567405&classid48=667021859&classid49=667021860&classid50=667021861&classid51=667021863&classid52=667021864&classid53=667021865&classid54=667021866&classid55=667021867&classid56=667021868&classid57=667021869&classid58=667021870&classid59=667021871&classid60=667021872&classid61=667021873&classid62=783092523&classid63=783092524&classid64=783092525&classid65=783092526&classid66=783092527&classid67=783092528&classid68=783092529&classid69=783092530&classid70=783092532&classid71=783092533&classid72=783092534&classid73=783092535&classid74=783092536&classid75=783092537&classid76=783092538&classid77=783092539&classid78=783092540&classid79=945464709&classid80=945464710&classid81=945464711&classid82=945464712&classid83=945464713&classid84=945464714&classid85=945464715&classid86=945464716&classid87=945464717&classid88=945464718&classid89=945464719&classid90=903185406%27

But, anyway, its not full list of items.

from loungedestroyer.

 avatar commented on July 18, 2024

then how most of the bet websites have all items ? And thanks for your response!

from loungedestroyer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.