Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Secuencia de comandos Jquery de Steam webAPI. devolver

Tengo un problema con este script que obtuve de github.

Yo mismo agregué value.appid porque parecía lógico, pero creo que data.response.games es una respuesta para todos mis juegos y sus valores.

¿Cómo hago para que impriman o vean lo que está definido?

Necesitaría algo como value.description o quizás value.ownedAchievements .

Quiero ver con qué datos tengo que trabajar para el CSV.

Soy un completo novato con esto, así que sé amable, también los comentarios de expertos no tendré idea de qué hacer porque nunca antes había tocado javascript en mi vida.

Actualmente estoy aprendiendo HTML CSS y PHP.

También tengo un Docker ejecutándose con mi SQL ... ¿hay alguna forma de rediseñar este script para poner directamente estos valores value.* dentro de una columna? sin necesidad de descargar un CSV e importarlo manualmente todo el tiempo.

 <script src='http://code.jquery.com/jquery-2.1.1.min.js' type='text/javascript'></script> <script type='text/javascript'> $(document).ready(function () { function exportSteamToCSV(filename) { var url = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=" + $('#webkey').val() + "&steamid=" + $('#steamid').val() + "&format=json&include_appinfo=1"; $.get(url, function(data) { colDelim = ','; rowDelim = '"\r\n"'; csv = '"Name","Playtime","Store' + rowDelim; $.each(data.response.games, function(index, value) { url = "http://store.steampowered.com/app/" + value.appid; csv += value.name + colDelim + value.playtime_forever + colDelim + value.appid + colDelim + url + rowDelim; //csv += value.name + colDelim + value.playtime_forever + colDelim + url + rowDelim; Was correct eerste versie }); csv += '"'; csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv); var link = document.createElement("a"); link.download = filename; link.href = csvData; link.target = "_blank"; link.click(); }); }; $(".export").on('click', function (event) { // CSV exportSteamToCSV.apply(this, ['steamgames.csv']); }); }); </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Resuelto esto luego en Laravel con la consulta de la APU. la URL solo obtiene todos los datos... a partir de ahí puedes hacer casi cualquier cosa.

 $url = "https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=XXXXXXXXXX&steamid=XXXXXXXXXXformat=json&include_appinfo=1"; $jsondata = file_get_contents($url); $parsed = json_decode($jsondata,true); $games = $parsed['response']['games']; echo SteamGame::count(); foreach($games as $game){ echo $game['name']."<br>"; $imgid = $game['appid']; SteamGame::updateOrCreate(['name' => $game['name']],[ 'name' => $game['name'], 'appID' => $game['appid'], 'storeURL' => "https://store.steampowered.com/app/".$game['appid'], 'imageURL' => "https://cdn.akamai.steamstatic.com/steam/apps/${imgid}/header.jpg", 'minutesplayed' => $game['playtime_forever'] ]);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!