@ -1011,7 +1011,7 @@ var MAX_INDEX = 12 //To prevent being rate-limited.
function Process ( data , ind ) {
function Process ( data , ind ) {
for ( var i in data . data . statuses ) {
for ( var i in data . data . statuses ) {
var tweet = data . data . statuses [ i ]
var tweet = data . data . statuses [ i ]
if ( tweet . source && tweet . source . includes ( "Nintendo Switch Share" ) ) {
if ( tweet . source && tweet . source . includes ( "Nintendo Switch Share" ) || tweet . source . includes ( "PlayStation®Network" ) ) {
if ( tweet . extended _entities ) {
if ( tweet . extended _entities ) {
//console.log(tweet.extended_entities.media)
//console.log(tweet.extended_entities.media)
for ( var j = 0 ; j < tweet . extended _entities . media . length ; j ++ ) {
for ( var j = 0 ; j < tweet . extended _entities . media . length ; j ++ ) {
@ -1050,9 +1050,9 @@ axios.get('https://api.twitter.com/1.1/search/tweets.json?q=@divarbot', {
return Process ( data ) ;
return Process ( data ) ;
} )
} )
. then ( ( data ) => { process _images . forEach ( ( image ) => { console . log ( image ) } ) } ) * /
. then ( ( data ) => { process _images . forEach ( ( image ) => { console . log ( image ) } ) } ) * /
/ * s e t I n t e r v a l (
setInterval (
( ) => {
( ) => {
twitchStreams . get ( 'radi7002 ' )
twitchStreams . get ( 'smallant ' )
. then ( function ( streams ) {
. then ( function ( streams ) {
//console.log(streams)
//console.log(streams)
if ( streams . length > 0 ) {
if ( streams . length > 0 ) {
@ -1062,7 +1062,7 @@ axios.get('https://api.twitter.com/1.1/search/tweets.json?q=@divarbot', {
. catch ( ( err ) => {
. catch ( ( err ) => {
console . log ( err . message )
console . log ( err . message )
} )
} )
} , 5000 ) * /
} , 5000 )
setInterval (
setInterval (
( ) => {
( ) => {
@ -1073,7 +1073,7 @@ setInterval(
uploadData . tries += 1 ;
uploadData . tries += 1 ;
}
}
if ( uploadData . tries < 5 ) {
if ( uploadData . tries < 5 ) {
console . log ( "Failed to upload. Added back to queue. Tries: " + uploadData . tries + " / " + json . stringify ( uploadData ) )
console . log ( "Failed to upload. Added back to queue. Tries: " + uploadData . tries + " / " + JSON . stringify ( uploadData ) )
db . query ( "insert into uploadedplays(filename,userid,submissiondate,id,playid,tries) values($1,$2,$3,$4,$5,$6);" ,
db . query ( "insert into uploadedplays(filename,userid,submissiondate,id,playid,tries) values($1,$2,$3,$4,$5,$6);" ,
[ uploadData . filename , uploadData . userid , uploadData . submissiondate , uploadData . id , uploadData . playid , uploadData . tries ] )
[ uploadData . filename , uploadData . userid , uploadData . submissiondate , uploadData . id , uploadData . playid , uploadData . tries ] )
}
}