Migrating to botodon and soc.wadza.fr

master
Clement Bois 2019-06-17 17:12:42 +02:00
parent e233291e48
commit a97118e14d
10 changed files with 3221 additions and 1938 deletions

View File

@ -1,7 +0,0 @@
API_URL=test-url
ACCESS_TOKEN=test
VISIBILITY=unlisted
VISIBILITY_FR=private
ACCESS_TOKEN_FR=test1
VISIBILITY_EN=private
ACCESS_TOKEN_EN=test2

View File

@ -1,30 +0,0 @@
{
"env": {
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Compliment
Migrated to https://soc.wadza.fr/compliment and using https://git.wadza.fr/me/botodon

14
actions.json Normal file
View File

@ -0,0 +1,14 @@
[
{
"id": "local",
"tags": ["botodon", "data_file", "followers"]
},
{
"id": "local-en",
"tags": ["botodon", "data_file", "data_deep", "data_tagged_en", "favourites_9jwKWP2dynf1bVrv2u"]
},
{
"id": "local-fr",
"tags": ["botodon", "data_file", "data_deep", "data_tagged_fr", "favourites_9jwKcp5a36Ui7sIssa"]
}
]

File diff suppressed because it is too large Load Diff

302
database.multi.json Normal file
View File

@ -0,0 +1,302 @@
[
{
"content": "\n[EN] Youre that “Nothing” when people ask me what Im thinking about.\n\n[FR] Quand on me demande à quoi je pense, je nose pas dire que je pense toujours à toi"
},
{
"content": "\n[EN] You look great today.\n\n[FR] Tu as lair en pleine forme aujourdhui."
},
{
"content": "\n[EN] Youre a smart cookie.\n\n[FR] Tu es un vrai chou à la crème"
},
{
"content": "\n[EN] I bet you make babies smile.\n\n[FR] Je parie que les bébés sourient en te voyant."
},
{
"content": "\n[EN] You have impeccable manners.\n\n[FR] Tu as un goût exquis."
},
{
"content": "\n[EN] I like your style.\n\n[FR] Jadore ton style."
},
{
"content": "\n[EN] You have the best laugh.\n\n[FR] Tu as un rire charmant"
},
{
"content": "\n[EN] I appreciate you.\n\n[FR] Jaime beaucoup ce que tu fais et ce que tu es."
},
{
"content": "\n[EN] You are the most perfect you there is.\n\n[FR] Tu es la personne la plus parfaite que je connaisse"
},
{
"content": "\n[EN] Our system of inside jokes is so advanced that only you and I get it. And I like that.\n\n[FR] Notre complicité est géniale, jadore les clins dœil que nous nous faisons."
},
{
"content": "\n[EN] Youre strong.\n\n[FR] Tu as de la personnalité, on peut te faire confiance."
},
{
"content": "\n[EN] Your perspective is refreshing.\n\n[FR] Quand on te croise, la journée est moins dure."
},
{
"content": "\n[EN] Youre an awesome friend.\n\n[FR] Ton amitié est précieuse."
},
{
"content": "\n[EN] You light up the room.\n\n[FR] Quand tu apparais, tu illumines tout."
},
{
"content": "\n[EN] You deserve a hug right now.\n\n[FR] Tu mérites quon tembrasse dès maintenant."
},
{
"content": "\n[EN] You should be proud of yourself.\n\n[FR] Tu peux être content⋅e de toi."
},
{
"content": "\n[EN] Youre more helpful than you realize.\n\n[FR] Ton aide est précieuse plus encore que tu ne limagines."
},
{
"content": "\n[EN] You have a great sense of humor.\n\n[FR] Tu as un sacré sens de lhumour."
},
{
"content": "\n[EN] Youve got all the right moves!\n\n[FR] Tu réussis tout ce que tu entreprends !"
},
{
"content": "\n[EN] Is that your picture next to “charming” in the dictionary?\n\n[FR] Dans le dictionnaire, cest ton portrait qui illustre le mot 'charme'"
},
{
"content": "\n[EN] Your kindness is a balm to all who encounter it.\n\n[FR] Ta gentillesse est un parfum qui embaume tous ceux qui tentourent."
},
{
"content": "\n[EN] Youre all that and a super-size bag of chips.\n\n[FR] Tu es tout pour nous et bien plus encore."
},
{
"content": "\n[EN] On a scale from 1 to 10, youre an 11.\n\n[FR] Sur une échelle de 1 à 10, tu es à 11."
},
{
"content": "\n[EN] You are brave.\n\n[FR] Jadmire ton courage."
},
{
"content": "\n[EN] Youre even more beautiful on the inside than you are on the outside.\n\n[FR] Tu es encore plus magnifique à lintérieur quà lextérieur."
},
{
"content": "\n[EN] You have the courage of your convictions.\n\n[FR] Tu as le courage de défendre tes convictions."
},
{
"content": "\n[EN] Aside from food. Youre my favorite.\n\n[FR] Après le tiramisu, cest toi que je préfère."
},
{
"content": "\n[EN] If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.\n\n[FR] Si les licornes existaient, elles te feraient une haie dhonneur chaque matin."
},
{
"content": "\n[EN] You are making a difference.\n\n[FR] Tu fais vraiment la différence quand tu arrives."
},
{
"content": "\n[EN] Youre like sunshine on a rainy day.\n\n[FR] Tu es comme un rayon de soleil après la pluie."
},
{
"content": "\n[EN] You bring out the best in other people.\n\n[FR] Avec toi, chacun donne le meilleur de soi-même."
},
{
"content": "\n[EN] Your ability to recall random factoids at just the right time is impressive.\n\n[FR] Ta mémoire est telle que tu noublies rien des moments heureux."
},
{
"content": "\n[EN] Youre a great listener.\n\n[FR] Tu sais écouter les autres avec une réelle attention."
},
{
"content": "\n[EN] How is it that you always look great, even in sweatpants?\n\n[FR] Comment se fait-il que tu aies toujours lair impeccable, même avec un vieux survèt ?"
},
{
"content": "\n[EN] Everything would be better if more people were like you!\n\n[FR] Le monde tournerait bien mieux si les autres étaient comme toi !"
},
{
"content": "\n[EN] I bet you sweat glitter.\n\n[FR] Je parie que tes gouttes de sueur sont des perles."
},
{
"content": "\n[EN] You were cool way before hipsters were cool.\n\n[FR] Tu étais déjà cool avant que la coolitude soit à la mode."
},
{
"content": "\n[EN] That color is perfect on you.\n\n[FR] Les couleurs que tu choisis te vont très bien."
},
{
"content": "\n[EN] Hanging out with you is always a blast.\n\n[FR] Se balader à tes côtés est une vraie partie de plaisir."
},
{
"content": "\n[EN] You always know — and say — exactly what I need to hear when I need to hear it.\n\n[FR] Tu sais toujours dire exactement ce que jai besoin dentendre."
},
{
"content": "\n[EN] You smell really good.\n\n[FR] Ton parfum est un enchantement."
},
{
"content": "\n[EN] You may dance like no ones watching, but everyones watching because youre an amazing dancer!\n\n[FR] Tu danses comme si personne ne te regardait, mais tu danses si bien que tout le monde te regarde !"
},
{
"content": "\n[EN] Being around you makes everything better!\n\n[FR] Tout va mieux quand tu es tout près de moi !"
},
{
"content": "\n[EN] When you say, “I meant to do that,” I totally believe you.\n\n[FR] Quand tu dis 'Voilà ce que je vais faire', jai envie de le faire avec toi."
},
{
"content": "\n[EN] When youre not afraid to be yourself is when youre most incredible.\n\n[FR] Tu es incroyable quand tu nas pas peur dêtre toi-même."
},
{
"content": "\n[EN] Colors seem brighter when youre around.\n\n[FR] Ta seule présence ravive les couleurs du quotidien."
},
{
"content": "\n[EN] Youre more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)\n\n[FR] Tu es plus chouette quun énorme paquet de chamallows."
},
{
"content": "\n[EN] That thing you dont like about yourself is what makes you so interesting.\n\n[FR] Cest ce que tu naimes pas chez toi qui te rend une personne intéressante."
},
{
"content": "\n[EN] Youre wonderful.\n\n[FR] Tu es une merveille."
},
{
"content": "\n[EN] Everyday is just BLAH when I dont see you For reals! (awesome you are halfway through the list. Youre awesome!)\n\n[FR] Chaque jour est tristounet quand je ne te vois pas en vrai !"
},
{
"content": "\n[EN] Jokes are funnier when you tell them.\n\n[FR] Les blagues sont bien plus drôles quand cest toi qui les racontes."
},
{
"content": "\n[EN] Youre better than a triple-scoop ice cream cone. With sprinkles.\n\n[FR] Tu es un tel délice que les glaces à la framboise me paraissent fades."
},
{
"content": "\n[EN] Your bellybutton is kind of adorable.\n\n[FR] Même ton nombril est tout à fait mignon."
},
{
"content": "\n[EN] Your hair looks stunning.\n\n[FR] Ta chevelure est magnifique."
},
{
"content": "\n[EN] Youre one of a kind!\n\n[FR] Tu te distingues vraiment du lot !"
},
{
"content": "\n[EN] Youre inspiring.\n\n[FR] Tu es pour tout le monde une source dinspiration."
},
{
"content": "\n[EN] If you were a box of crayons, youd be the giant name-brand one with the built-in sharpener.\n\n[FR] Si tu étais un crayon de couleur, tu pourrais dessiner larc-en-ciel dun seul trait."
},
{
"content": "\n[EN] You should be thanked more often. So thank you!!\n\n[FR] Tout le monde peut te remercier. Merci pour tout ce que tu es !"
},
{
"content": "\n[EN] Our community is better because youre in it.\n\n[FR] Notre communauté est bien meilleure grâce à toi."
},
{
"content": "\n[EN] Someone is getting through something hard right now because youve got their back.\n\n[FR] En ce moment, une personne surmonte ses difficultés grâce à ton aide et ton soutien."
},
{
"content": "\n[EN] You have the best ideas.\n\n[FR] Tes idées sont les meilleures."
},
{
"content": "\n[EN] You always know how to find that silver lining.\n\n[FR] Tu tarranges toujours pour trouver le meilleur en chacun."
},
{
"content": "\n[EN] Everyone gets knocked down sometimes, but you always get back up and keep going.\n\n[FR] Tout le monde peut avoir un petit coup de blues, mais avec toi on surmonte cette épreuve."
},
{
"content": "\n[EN] Youre a candle in the darkness.\n\n[FR] Tu es comme une lumière dans lobscurité de nos vies."
},
{
"content": "\n[EN] Youre a great example to others.\n\n[FR] Tu es un exemple pour tout le monde."
},
{
"content": "\n[EN] Being around you is like being on a happy little vacation.\n\n[FR] Quand on est près de toi, cest comme si on était en vacances."
},
{
"content": "\n[EN] You always know just what to say.\n\n[FR] Tu sais toujours comment réagir face aux problèmes."
},
{
"content": "\n[EN] Youre always learning new things and trying to better yourself, which is awesome.\n\n[FR] Tu as tellement soif dapprendre et tu progresses tellement que tu es formidable."
},
{
"content": "\n[EN] If someone based an Internet meme on you, it would have impeccable grammar.\n\n[FR] Si on devait faire un mème pour Internet avec toi, ce serait avec tes paroles de sagesse."
},
{
"content": "\n[EN] You could survive a Zombie apocalypse.\n\n[FR] Tu peux survivre à toutes les apocalypses."
},
{
"content": "\n[EN] Youre more fun than bubble wrap.\n\n[FR] Tu es beaucoup plus drôle que les humoristes professionnels."
},
{
"content": "\n[EN] When you make a mistake, you fix it.\n\n[FR] Tu sais reconnaître tes erreurs et apprendre à mieux faire."
},
{
"content": "\n[EN] Who raised you? They deserve a medal for a job well done.\n\n[FR] Tes parents méritent dêtre récompensés de tavoir mis⋅e au monde."
},
{
"content": "\n[EN] Youre great at figuring stuff out.\n\n[FR] Tu sais fort bien démêler les affaires compliquées."
},
{
"content": "\n[EN] Your voice is magnificent.\n\n[FR] Ta voix est mélodieuse."
},
{
"content": "\n[EN] The people you love are lucky to have you in their lives.\n\n[FR] Les personnes que tu aimes ont bien de la chance !"
},
{
"content": "\n[EN] Youre like a breath of fresh air.\n\n[FR] Ton souffle est une brise de printemps."
},
{
"content": "\n[EN] Youre gorgeous — and thats the least interesting thing about you, too.\n\n[FR] Tu es splendide, mais cest la moindre de tes qualités."
},
{
"content": "\n[EN] Youre so thoughtful.\n\n[FR] Tu es une personne réfléchie et fiable."
},
{
"content": "\n[EN] Your creative potential seems limitless.\n\n[FR] Ton potentiel créatif paraît sans limites."
},
{
"content": "\n[EN] Youre the coolest person I know. And I consider myself bet friends with like all celebrities, so. . . .\n\n[FR] Tu es la personne la plus géniale que je connaisse. Et je connais pourtant beaucoup de personnes très sympas…"
},
{
"content": "\n[EN] Youre irresistible when you blush.\n\n[FR] Tu es irrésistible quand tu rougis."
},
{
"content": "\n[EN] Actions speak louder than words, and yours tell an incredible story.\n\n[FR] Les actes valent mieux que les mots, et tes actes le prouvent chaque jour."
},
{
"content": "\n[EN] Somehow you make time stop and fly at the same time.\n\n[FR] Avec toi le temps passe tellement vite quon ne sennuie jamais."
},
{
"content": "\n[EN] When you make up your mind about something, nothing stands in your way.\n\n[FR] Quand tu as pris une décision, rien ne peut plus tarrêter."
},
{
"content": "\n[EN] You seem to really know who you are.\n\n[FR] Tu as lair de savoir vraiment ce que tu veux."
},
{
"content": "\n[EN] Any team would be lucky to have you on it.\n\n[FR] Toutes les associations et clubs voudraient bien que tu les rejoignes."
},
{
"content": "\n[EN] In high school I bet you were voted “most likely to keep being awesome.”\n\n[FR] Tu étais sûrement la personne la plus populaire pendant tes études, tu les toujours aujourdhui.”"
},
{
"content": "\n[EN] I bet you do the crossword puzzle in ink.\n\n[FR] Je parie que tu termines les mots croisés en 5 minutes."
},
{
"content": "\n[EN] Babies and small animals probably love you.\n\n[FR] Je parie que les chiens et les chats viennent spontanément près de toi avec amour."
},
{
"content": "\n[EN] If you were a scented candle theyd call it Perfectly Imperfect (and it would smell like summer).\n\n[FR] Si tu étais un parfum on tappellerait 'Fleurs dété'."
},
{
"content": "\n[EN] Theres ordinary, and then theres you.\n\n[FR] Il y a les gens ordinaires, et puis il y a toi."
},
{
"content": "\n[EN] Youre someones reason to smile.\n\n[FR] Tu donnes envie de sourire quand on te voit."
},
{
"content": "\n[EN] Youre even better than a unicorn, because youre real.\n\n[FR] Tu vaux bien mieux quune licorne parce que tu existes vraiment."
},
{
"content": "\n[EN] How do you keep being so funny and making everyone laugh?\n\n[FR] Comment tu fais pour être si drôle et faire rire autour de toi ?"
},
{
"content": "\n[EN] You have a good head on your shoulders.\n\n[FR] Tu as la tête sur les épaules en toutes circonstances."
},
{
"content": "\n[EN] Has anyone ever told you that you have great posture?\n\n[FR] On ta déjà dit à quel point ton allure est impressionnante ?"
},
{
"content": "\n[EN] The way you treasure your loved ones is incredible.\n\n[FR] Tu es incroyable avec les personnes que tu aimes."
},
{
"content": "\n[EN] Youre really something special.\n\n[FR] Tu es vraiment une personne très spéciale."
},
{
"content": "\n[EN] Youre a gift to those around you.\n\n[FR] Ta présence est un cadeau pour celles et ceux qui tentourent."
}
]

1402
database.single.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
require('dotenv').config()
const database = require('./database.json')
const Mastodon = require('mastodon-api')
const TOKEN = 'ACCESS_TOKEN'
const URL = 'API_URL'
const VISIBILITY = 'VISIBILITY'
Object.entries(process.env)
.filter(e => e[0].startsWith(TOKEN))
.forEach(e => {
const lang = e[0].substring(TOKEN.length + 1)
const visi = process.env[`${VISIBILITY}_${lang}`] || process.env[VISIBILITY]
const M = new Mastodon({
access_token: process.env[`${TOKEN}_${lang}`] || process.env[TOKEN],
api_url: `${process.env[`${URL}_${lang}`] || process.env[URL]}/api/v1/`,
timeout_ms: 60 * 1000
})
M.get('accounts/verify_credentials').then(
me => {
if (me.data.error) {
console.error(me.data.error)
return
}
M.get(`accounts/${me.data.id}/followers`, { limit: 9999 }).then(fol => {
for (const follow of fol.data) {
const messages = database[Math.floor(Math.random() * database.length)]
const text = lang.length > 0 ? messages[lang] : '\n' + Object.entries(messages).map(m => `[${m[0]}] ${m[1]}`).join('\n\n')
M.post('statuses', { status: `@${follow.acct} ${text}`, visibility: visi })
}
})
})
})

1644
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
{
"name": "compliment",
"version": "0.0.1",
"description": "Send random happiness",
"homepage": "https://git.wadza.fr/sheychen/compliment",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"bot",
"mastodon"
],
"author": "@shu@eldritch.cafe",
"license": "MIT",
"dependencies": {
"dotenv": "^7.0.0",
"mastodon-api": "^1.3.0"
}
}