123456789101112131415161718192021222324252627282930 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- const path = require("path");
- const twitter_1 = require("./twitter");
- const webshot_1 = require("./webshot");
- const configPath = './config.json';
- let config, worker;
- try {
- config = require(path.resolve(configPath));
- worker = new twitter_1.default(Object.fromEntries(Object.entries(config).map(([k, v]) => [k.replace('twitter_', '').replace(/_(.)/g, (_, $1) => $1.toUpperCase()), v])));
- }
- catch (e) {
- console.log('Failed to parse config file: ', configPath);
- process.exit(1);
- }
- const webshot = new webshot_1.default(config.playwright_ws_spec_endpoint, worker.mode, () => {
- worker.webshot = webshot;
- worker.getTweet('1296935552848035840', (msg, text, author) => {
- console.log(author + text);
- console.log(JSON.stringify(msg));
- }).catch(console.log);
- worker.getTweet('1296935552848035841', (msg, text, author) => {
- console.log(author + text);
- console.log(JSON.stringify(msg));
- }).catch(console.log);
- });
- worker.queryUser('tomoyokurosawa').then(console.log).catch(console.log);
- worker.queryUser('tomoyourosawa').then(console.log).catch(console.log);
- worker.queryUser('@tomoyokurosawa').then(console.log).catch(console.log);
- //# sourceMappingURL=twitter_test.js.map
|