If you have a web server, you could cache all the scores into your server and make an api that allows multiple games at once. So instead of calling mashape.com one game at a time, you could call yourserver.com and retrieve the cached data in one single ajax call. You can always refresh your cache using a cron or on-demand.
Comment has been collapsed.
I've thought about this but i'm not sure i want to setup a server only for this, in the meanwhile i'm caching using the browser localstorage, it's not so good if i want to use a different browser or pc but in the meanwhile it's better than before.
Comment has been collapsed.
That would improve subsequent calls, but for every first time call or when you clear your local storage, it'll be ajax-ing one game at a time again. If you want, I can sponsor a small little web space for you to experiment. Add me if interested.
Comment has been collapsed.
Enhanced Steam will add the user metacritic score to the page for you (in the normal place though) if you're intereted in that.
Comment has been collapsed.
47,279 Comments - Last post 13 minutes ago by kbronct
2,264 Comments - Last post 28 minutes ago by tiofw
441 Comments - Last post 1 hour ago by xitau
215 Comments - Last post 2 hours ago by Atombomb2097
20 Comments - Last post 6 hours ago by Mayanaise
24 Comments - Last post 11 hours ago by wormmayhem
1,031 Comments - Last post 12 hours ago by MrTommy
43 Comments - Last post 2 minutes ago by ObsidianSpire
284 Comments - Last post 4 minutes ago by pingu23
1,516 Comments - Last post 9 minutes ago by xurc
4,712 Comments - Last post 32 minutes ago by CommissarCiaphasCain
726 Comments - Last post 33 minutes ago by Deleted2137
123 Comments - Last post 33 minutes ago by gus09
780 Comments - Last post 1 hour ago by alexfirehouse
Hi, i wanted to display the metacritic score of the games in the homepage near their names.
(Check the image below to see what i see now.)
I've used the unofficial metacritic api at this page API and this is my code :
(Sorry if my code is bad, i don't have so much experience with web development)
Due all the ajax calls the code is slow and it takes a few seconds to load the scores and i don't think those api have an option for asking for multiple games at once.
Do you have any suggestion on how to improve the speed of this script?
Thanks.
Comment has been collapsed.