Answer the question
In order to leave comments, you need to log in
How to pull the entire list of Steam games?
There is a URL where all the games are written as a json string. How
now to pull them out from there to your site?
Answer the question
In order to leave comments, you need to log in
An hour later, I decided myself here is the answer:
PHP function where we refer.
$allGamesObject = json_decode(file_get_contents(asset('/json/games.txt')));
// тут можно использовать URL, файл или БД для выборки.
return $allGames = $allGamesObject->applist->apps->app;
// вернет массив обьектов. Каждая игра обьект.
var token = $('input[name="_token"]').val(),
gameName = $('#gameName').val();
$.ajax({
url: '/getsteamgames',
type: 'POST',
dataType: 'json',
data: {
'gameName': gameName,
'_token': token,
},
})
.done(function(data) {
$.each(data, function(index, element) {
var game_name = element.name;
$('body').prepend( game_name );
});
})
.fail(function() {
console.log("ERROR");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question