This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System; | |
using System.ComponentModel; | |
using System.Net.Sockets; | |
using System.IO; | |
public class TwitchIntegration : MonoBehaviour{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css"> | |
<title>neighborhoodSign</title> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Collecting data using jquery | |
function collectData(id) { | |
let dataCollected = { 'name': "", data: [] }//[] | |
$(`#${id}`).children('').each((i, el) => { | |
dataCollected.name = el.id.slice(0, -1); | |
if (el.tagName == "INPUT") { | |
dataCollected.data.push({ 'name': el.id, 'data': $(el).val() }) | |
} | |
}) | |
return dataCollected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const morgan = require('morgan'); | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const socketIo = require('socket.io'); | |
const app = express(); | |
const server = http.createServer(app); | |
const routes = require('./routes/routes'); | |
const io = socketIo(server); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const download = require('image-downloader') | |
const detectFood = require('./detectFood'); | |
//read txt file and convert to array | |
function readFileLineByLine(dataPath){ | |
return new Promise(function(resolve,reject){ | |
let dataset = [] | |
let rl = readline.createInterface({ | |
input: fs.createReadStream(dataPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Have you cooked it? good. I only perceive one thing from this cheeseburger: flavor | |
Wow.... That burger just 'good cooking'. Can i bite it | |
I want to try that food, it looks delectable. Wow.... That burger just 'flavor' | |
Too delicious. The burger talks about ''good cooker'' | |
I want to try that food, it looks delicious. looking that burger you can perceive: good cooking | |
Wow.... That burger just 'good cooking'. The photo tells me that i must attack it | |
It seems delicious. I only perceive one thing from this cheeseburger: made with love | |
I want to try that food, it looks delectable. Wow.... That burger just 'good cooking' | |
I only perceive one thing from this cheeseburger: good cooker. I want to eat it | |
That food looks like fine. I only perceive one thing from this cheeseburger: good cooker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const download = require('image-downloader') | |
const detectFood = require('./detectFood'); | |
//download instagram post | |
async function downloadPost(ig,media_id){ | |
try { | |
let postToDownload = await getMediaIdInfo(ig,media_id); | |
let downloadedData = await downloadImageFromUrl(postToDownload.items[0].image_versions2.candidates[0].url,media_id); | |
return downloadedData; | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//instagram workflow | |
(async () => { | |
let ig = await login(); //login | |
await setAntiBanMode(ig); //anti-ban Mode | |
//repeat this every hour | |
setInterval(async () => { | |
let posts = await recentHashtagList(ig, "foodporn"); //get all hashtags in #foodporn hashtag | |
for(let i = 0 ; i < posts.length ; i++){ | |
let actualPost = await downloadPost(ig,posts[i].pk) //download picture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const download = require('image-downloader') | |
const detectFood = require('./detectFood'); | |
//download instagram post | |
async function downloadPost(ig,media_id){ | |
try { | |
let postToDownload = await getMediaIdInfo(ig,media_id); | |
let downloadedData = await downloadImageFromUrl(postToDownload.items[0].image_versions2.candidates[0].url,media_id); | |
return downloadedData; | |
} catch (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spawn = require('child_process').spawn; | |
//create friendly js prediction | |
function decodePrediction(str){ | |
let decode = str.split('-'); | |
return { | |
"label" : decode[0], | |
"percentage" : Math.trunc(decode[1]) | |
} | |
} |