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
require('tools-for-instagram'); | |
//Variables to handle intervals | |
const likesPerInterval = 15; | |
const followsPerInterval = 15; | |
//hashtags on which we are going to act | |
const hashtags =[ | |
"vegan", | |
"vegetarian", |
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
//UTILS | |
const D2R = Math.PI/180.0; | |
Number.prototype.toRadians = function() { | |
return this * D2R; | |
}; | |
//DATA | |
let circleAvenidaDiagonal = { | |
center:{ lat:41.396266,lng:2.150205 }, | |
radius:1 |
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
int distance = calculateDistance(circle1.center, circle2.center); | |
int r1 = circle1.radius(); | |
int r2 circle2.radius(); | |
boolean overlap = distance < r1+r2; |
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 utils = require('./utils.js'); | |
function generate(listVerbs,listSentences,emojis = false,listEmojis = [], emojisRandomChance = 3){ | |
return new Promise( function(resolve, reject){ | |
let getAllSentences = [] | |
for(let i = 0 ; i < listSentences.length; i++){ | |
let sentenceToReplace = listSentences[i] | |
for(let j = 0 ; j < listVerbs.length;j++){ | |
sentenceToReplace = sentenceToReplace.replace("$",listVerbs[j]) |
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 fs = require('fs'); | |
const readline = require('readline'); | |
function randomInt(min,max){ | |
return Math.round(Math.random() * (max-min)+ min) | |
} | |
function saveArrayToTxtLineByLine(arrFinal,pathOutput){ | |
return new Promise(function(resolve,reject){ | |
let fileToSave = deleteRepeatedValuesOnArray(arrFinal) |
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 utils = require('../src/utils.js'); | |
const generateCommentsFromHandMadeData = require('../src/generateCommentsFromHandMadeData.js') | |
let sentencesAboutFood = { | |
"mainSentence":[ | |
"This picture looks $", | |
"Looks $, i love your pictures", | |
"I want to try that food, it looks $", | |
"It seems $" | |
], |
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 utils = require('../src/utils.js'); | |
const generateCommentsFromHandMadeData = require('../src/generateCommentsFromHandMadeData.js') | |
let sentencesAboutPicture ={ | |
"mainSentence": [ | |
"I love photography, it transmits $", | |
"The photo talks about $", | |
"Just '$'", | |
"Beyond photography you can perceive: $", | |
"$!", |
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 utils = require('../src/utils.js'); | |
const generateCommentsFromHandMadeData = require('../src/generateCommentsFromHandMadeData.js') | |
const howManyIterations = 99999; | |
let allSentences = []; | |
let sentencesAboutPicture ={ | |
"mainSentence": [ | |
"I love photography, it transmits $", | |
"The photo talks about $", |
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 titlegen = require('titlegen'); | |
const utils = require('./utils.js'); | |
async function generate(path,howManyChain){ | |
return new Promise(async function(resolve,reject){ | |
let generator = titlegen.create(); | |
let finalTextMarkov = [] | |
let dataset = []; |
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
async function markovChain(){ | |
let amazonDataSetFile = await utils.readFileLineByLine('../dataset/AmazonDataSet.txt') | |
let ourDataSet = await utils.readFileLineByLine('../dataset/sentences.txt') | |
let filteredData = amazonDataSetFile.filter((comments) => { | |
if(comments.includes("taste") || comments.includes("yummy") || comments.includes("good") || comments.includes("cooking") || comments.includes("delicious") || comments.includes("savory") || comments.includes("devour")){ | |
return comments | |
} | |
}) | |
filteredData = filteredData.slice(0,3500) | |
let bothDataSetsTogether = [...filteredData,...ourDataSet] |