Skip to content

Commit

Permalink
Private replies
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanmik committed Oct 17, 2021
1 parent b9b3e3d commit 10b517c
Show file tree
Hide file tree
Showing 2 changed files with 296 additions and 0 deletions.
44 changes: 44 additions & 0 deletions data/fetch-private-answers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const Redis = require('ioredis');
const fs = require('fs');
const { promisify } = require('util');
const writeFile = promisify(fs.writeFile);
const { decodeAnswersToken } = require('../src/utils');

let redis;

if (process.env.REDIS_URL) {
redis = new Redis(
process.env.REDIS_URL,
process.env.REDIS_URL.includes('rediss://')
? {
tls: {
rejectUnauthorized: false,
},
}
: {}
);
}

(async () => {
const keys = await redis.keys('poll:private:*');
let values = [];

if (keys.length > 0) {
values = await redis.mget(keys);
}

const out = [];

keys.forEach((key, index) => {
const split = key.split(':');
const token = split[2];

if (values[index]) {
reply = (decodeAnswersToken(values[index]) || []).join('');
out.push(reply);
}
});

await writeFile('private_replies.json', JSON.stringify(out, null, 2));
console.log('done');
})();
252 changes: 252 additions & 0 deletions data/private_replies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
[
"5255555555551325325514515542551555153555",
"5512555545135545315415543441551252552255",
"5413145411143455415133552135541421512234",
"5255545544553434245325444554551454125555",
"5255555545331325415525425233551454443545",
"4555544424554515425424431455543423445545",
"5544445434543322245425434533543432542245",
"5155545545151435425525525141551545155555",
"4122454511144525145444541145422111142425",
"5411355566166455525166564111546321542164",
"5454545545555415355524445455552545245555",
"5544225443543324324454152552545524343455",
"5534514411145544345441111155513424422355",
"5544455544444455445355255441444445445454",
"4255545555541414425515545354551444255555",
"5455545555452514314424434532441434345444",
"5224455544141415515235453151542525552555",
"4454455534342414224444434255551545435555",
"5544552214144443441225454132521442542355",
"5255545534552415525525435555451432144535",
"5144555455342415335434434344442444444445",
"1355544425551535345425435454442444333545",
"3555523212544211254553121535343335114333",
"5145555556551515315614535631451564656555",
"5145555555351415315515545151531555355455",
"5231455555524515515113445115122553551454",
"5255555554451414421515525451551545244554",
"5544552214144443445225454132521442542355",
"5134555555441315315515525454551554453554",
"5344434424244543445234443232431333445545",
"5555545535543415245243143545551323454445",
"5155435324151525315215523122531555355555",
"4533343223333333343443332343333312432333",
"5254555545551414215524525444551444155555",
"5454545512244545535435334244433222443334",
"5245555555451313315525443455432554332555",
"4155545525151415315215515131551555355555",
"4555544435555414255544144555554344125555",
"5235555555551525315415545141451555454345",
"5524422512345525444114354445532413552524",
"5255555545552515345525635544456545655555",
"5545554544552315215542143545244412143545",
"5544534314145544445344454245441244542555",
"5553543314144524445553232145422422324435",
"4454554514253545535324443131533342543245",
"5433445533424444425323444145431454552234",
"5155444414141225425424444111541455454555",
"5155445555551415245415545551551453154555",
"5454455535433434335324525553551555254355",
"5224555555553415415515525551451553353455",
"5412455555545555553155535111551553551355",
"5355525545551515435525445555551445134555",
"5111455545511125515515515521551521551255",
"5555545533554425244454134555454434315355",
"5135555555451515515515515353551545656555",
"5255545545552325425525544454551454345545",
"5235555555543324315524545343452543243355",
"5255545555441534435424515244451544343545",
"5524345511143334324443142355513333432345",
"4433333333333333333333333333333333333333",
"4524444422244425225444351254442312422244",
"5155565424351425425625465231551555354545",
"5155545525351515345514515131441555355555",
"5456525524141565445415445121562656543245",
"5334455544341554544335435221532442553245",
"5254545555543415315525425554551444154435",
"4425525524131515345134345122233442442335",
"5332555535131415325513535331551552551355",
"5155555555451515325524435355452545135555",
"5113231522555424413342155323541534551154",
"5145555545351534415415525142551545354455",
"5355355555552414334425525555553554135555",
"5254324432241424435425334122431244243344",
"5155555555451315325515535332551345145555",
"5454555544552544325444242554553444244455",
"5155555524151525325515515121541555355555",
"5255555555551214145515445344451555125545",
"5554544535553415355444144555554443125455",
"5443442435435245244442353344551422443154",
"5413433434144445525134332115443451552344",
"5523433311135334333433343134431324443434",
"5255555555451415325515445334354545145555",
"5555445435552435334523244554451445145555",
"4444433335544433334542244554451434345555",
"5234555545432415315524425335452453432255",
"5255555555551514425515535452552545345455",
"4524444411144214244542141155325413444244",
"5155525525251515415525514121541555454555",
"5323555533531535115435553355551553451355",
"5124455544555555515544545144551454155255",
"5145555555351525415515525142551555324455",
"5322555544522325415525545354552351551333",
"4121241511115453412524545425451434551153",
"5354555514234435325324355332513642542265",
"4455545555452316125564533455553444325545",
"5155555555551355555245454152433333332245",
"5255555555441415415535445341451444125555",
"5516355555633445344443335122331331555553",
"5254554445541324225515435344551535143555",
"5555433324553215255542242555434524125445",
"1355545555331213324515434344452514243544",
"5411435511152554525232543112321321533355",
"5155555555451435415515535141551555155555",
"5555555545553415255544254555554444125555",
"5313555555131535515155515153551551555355",
"1135444513343524235442351145424424523225",
"5255515545551325225534555553551545215555",
"5412251533125555555135552115541111153333",
"5145555555351415615515565222551554355545",
"5555555555451325115515525233551555155555",
"5155555533351515425615525232551545354555",
"5434545555544435215614525551556645241255",
"5111555555514245424144545254555153553355",
"5533342213133324215133242142333321541145",
"5255435555442215333423334443453544244445",
"5455545543551315114435345554551545135545",
"5154545564141515665514665631541445654545",
"5253343455542115223444545453352555143455",
"5355535545551313144525435555551545135555",
"5254555555532515315415525341451455353355",
"5343355445126316314526531164551662542434",
"5255545555552335235515445552451554135555",
"5255555555351414215524445453551544145555",
"5414555524244444425334455224451341543354",
"5545555535553425315343333545453434334455",
"5255545545551444415445555441551455254555",
"5355555545554415245524425554451545115555",
"5213555555132535515513435121551451553355",
"5422435411224555345124452341551141551454",
"5443345534224555535134344212343531541234",
"5253555344351525425215515121541555354555",
"5513455511135554515125552131531311551135",
"5413442511135545515224535132341341552243",
"5312555555445454424234334432552322352344",
"5155555545451515325523335421433555245555",
"5455555555451314215524445453551545145555",
"5334344455543413234334334533352434543354",
"5155555525151535425215515144551555355555",
"5155524411251423325514524251531535243545",
"5145555554551425415515545242551555142555",
"5455445514553214145544142555452424125545",
"5444534423123534335223553232531343352445",
"2211323355333153413313514111551541551143",
"5514444424341423325324444322541453253444",
"5255545554551314234424332433443544134545",
"5354444415143435335325545111531233353535",
"5555353333555115213432343555433341133335",
"5255555555551314325525225455551554125555",
"5455545555551414414515545554552444145555",
"5213555514445414315544555454451221452243",
"5511453413144554525134443322541221451144",
"2222445533124544515144544112441251541134",
"5155545545131313314515515232451444344545",
"5255545555551414425515545344551444255555",
"5155534344451315224413435335433555145555",
"5255545555551325324515435443551544145555",
"5233554555433545324124441232451544453455",
"5224555555141534525324345134553351551355",
"5511555556525555515454545121551441551555",
"5511522511122215414433152255544412521244",
"5255542255543114233454324444552544125535",
"2345555555352115115525435355552544325555",
"5155555545251313315515525141551554154555",
"5255555555351215315515435345451545155555",
"5444544414143544445225452124421441552345",
"5513555411144454414112152131421221552225",
"5255425425442225225525425452551444145555",
"5455555565451415535563434534353534344355",
"4555545535555414255544144555552544125555",
"5254544424342225224324424241542545254555",
"5532535513145155155553151155513111524235",
"5343443322243534545144444314441324555335",
"5454444424131413455545551145411332443333",
"1534455545544424245454143545551443352555",
"5155555545551325415225545551551555145555",
"5155525525251534315515435341551455153545",
"5255555545552424315323535554551343334545",
"5412455511114555545133533125341331551144",
"5434555524132525435133535221443432452434",
"5155555555451415415415535444551545154555",
"5255545555552325225525445555551545143555",
"5255544445441535525515445432442555454545",
"5455544414544424425544442555454424125555",
"5542455314123455555133441122522341554255",
"5413555545532555515565555133551552551455",
"5355555555441315314524325432453554345555",
"5213555555141114314515552555551551551155",
"5155424424141514325415525221541545454555",
"5355555535551215124522434554553545115555",
"5545545555543325445433452543552434535445",
"5514455522445255455125552154441611551353",
"2544564412255422255551151255436324124344",
"5245555545452525515524525254551443552445",
"5154545545242245414434435211351545454545",
"4522434422225425254342151155523213221234",
"5455555525251435415425525241531545354555",
"1222254534534345125535333153553545552355",
"5424515555312515115315535231513354553555",
"5145445554331314334416425336451544314545",
"5544424414135444345453141145522414441125",
"5255455555541412214515324351552555145555",
"5155545555551515315425525544551455154555",
"5455555435543424445544443554551424235545",
"5413554514334315415444543344531451342144",
"5155535525451535425414515151541455454555",
"5533543544411535215245552444353443513354",
"5555424325555325144553152555454322115355",
"5255565355551535565515545443551545354555",
"5322455555531445325113544232451342553344",
"5535554555554515425534445444553535535455",
"5534532434234433345224543152533313532245",
"5343445512131444415134324121432441342344",
"5523645512134464445125243164421621561136",
"5445545544543324335534233544443433333445",
"5544545511135354445145553151531251551545",
"5555555534542535515534634455453423454445",
"5355545554442333414414525331351444233334",
"5544514411145544345441151155513423422355",
"5155555455453545315215555551551555354555",
"5355555545351312335545324353553535135535",
"5423455545332535334414334554332633525555",
"5424555545444545415514522241551452552255",
"5516542411165425145153251155513431542555",
"5553555533533535535533555155551153551155",
"5255534423241313344234324232442444234435",
"4145555525521425124514515521353342235545",
"5141545555152515315515545111451553353555",
"4455545555452316125564533555553445315545",
"5255555545341515234324615344366553436644",
"5544424314133554545344544144441321552245",
"5355555555551513615524334553453555135555",
"3513151211111334131551151155414121511133",
"5155545435541415325514325544552443422535",
"5555555545553415254544254555554444125555",
"5135545555553223315515535443451445355555",
"5544434412144423434553151145524312534235",
"5511111111115155145553151155511511111153",
"5145545545541215535342535343451445352245",
"4555523312154315144552151155415311113124",
"5344455555133214434423434341451443343445",
"1211451125534525415515535333551211551143",
"5444545534552335334344434544342434343245",
"5544564421345424455124444142431141452354",
"3555433212534212254553141555343335114334",
"4523344424433123122543352255442213321134",
"5455545535552424345545142555552422234555",
"5255534424151313345224324232453445234545",
"5442555545454155525424551441125242114455",
"5455555445542425445242424554541424542245",
"5255515545551215645515545554551555145555"
]

0 comments on commit 10b517c

Please sign in to comment.