Echo of eternity avatar

SQL query: Posts, Tag, E DATA

sm-silva

Published: 28 Nov 2020 › Updated: 28 Nov 2020SQL query: Posts, Tag, E DATA

SQL query: Posts, Tag, E DATA

Sql server test

SELECT *
FROM DBHive.dbo.TxComments
WHERE parent_permlink = 'sql-ptbr' AND parent_author = '' AND [timestamp] >= Convert(datetime, '2020-11-27' ) ;

Como pegar somente posts recentes usando o hivesql:

SELECT author, permlink, title, created, body_language FROM DBHive.dbo.Comments WHERE parent_author = '' AND created >= Convert(datetime, '2021-06-02' );

Baixe em csv e converta pra json usando o https://csvjson.com/csv2json

Abrindo o Json usando o nodejs e filtrar o idioma somente em portugues:

const fs = require('fs');
let rawdata = fs.readFileSync('csvjson.json');
let datatop = JSON.parse(rawdata);

var data = [{}]

for (const index in datatop) {   
    if(datatop[index]['body_language'][0]){
        if(datatop[index]['body_language'][0]['language'] === 'pt'){
            if(datatop[index]['body_language'][0]['confidence'] > 5.0){
                console.log(datatop[index]['body_language'][0]['language'] + ' ' + index ) 
                data.push(datatop[index])
            }
        }
        else if(datatop[index]['body_language'][1]){ 
            if(datatop[index]['body_language'][1]['language'] === 'pt'){
                    if(datatop[index]['body_language'][1]['confidence'] > 5.0){
                        console.log(datatop[index]['body_language'][1]['language'] + ' ' + index ) 
                        data.push(datatop[index])
                    }
                }
        }
        else if(datatop[index]['body_language'][2]){ 
            if(datatop[index]['body_language'][2]['language'] === 'pt'){
                    if(datatop[index]['body_language'][2]['confidence'] > 5.0){
                    console.log(datatop[index]['body_language'][2]['language'] + ' ' + index ) 
                    data.push(datatop[index])
                    }
                }
        }
    }
    else{}
}

var newData1 = JSON.stringify(data);
fs.writeFile('csvjson1.json', newData1, err => {
    if(err) throw err;
    
    console.log("New data added");
});

Indice de Posts

Leave SQL query: Posts, Tag, E DATA to:

Written by

We're just a piece of time, but our actions echo for eternity.

Read more #sql-ptbr posts


Best Posts From Echo of eternity

We have not curated any of sm-silva's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Echo of eternity