Skip to content

Instantly share code, notes, and snippets.

@renoirtech
Created August 2, 2016 22:50
Show Gist options
  • Select an option

  • Save renoirtech/5308843b0c9ef8918679b04d5a2122c5 to your computer and use it in GitHub Desktop.

Select an option

Save renoirtech/5308843b0c9ef8918679b04d5a2122c5 to your computer and use it in GitHub Desktop.

Revisions

  1. Renoir Faria created this gist Aug 2, 2016.
    28 changes: 28 additions & 0 deletions getSteamDbGameTitles.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    // DECLARAÇÃO DE VARIÁVEIS
    var tabela = document.getElementById('table-apps');
    var $a = tabela.getElementsByTagName('A');
    var body = document.getElementsByTagName('BODY');

    body = body[0];

    //FUNÇÕES
    function criaTexto(texto){
    // CRIAÇÃO DE ELEMENTOS DOM
    quebraLinha = document.createElement('br');
    texto = document.createTextNode(texto);
    // INSERÇÃO DE ELEMENTOS DOM
    body.appendChild(texto);
    body.appendChild(quebraLinha);
    }

    // CAPTURA DE TITULO DOS JOGOS
    for(var i = 0; i<$a.length; i++){
    if(i% 2) {
    texto = $a[i].text;
    criaTexto(texto);
    }
    }

    alert("Sucesso");

    //FIM DO CÓDIGO.