TiddlyWiki5/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js
Saq Imtiaz 785086e0a5
Fixes ESLint errors (#9668)
* fix: apply automatic eslint fixes

* lint: allow hashbang comment for tiddlywiki.js

* lint: first back of manual lint fixes for unused vars

* lint: added more fixes for unused vars

* lint: missed files

* lint: updated eslint config with selected rules from #9669
2026-02-20 08:38:42 +00:00

46 lines
958 B
JavaScript

/*\
title: $:/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js
type: application/javascript
module-type: command
Read tiddlers from an unzipped Twitter archive
\*/
"use strict";
exports.info = {
name: "loadtwitterarchive",
synchronous: false
};
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
var self = this;
if(this.params.length < 1) {
return "Missing path to Twitter archive";
}
var archivePath = this.params[0];
// Load tweets
var archiveSource = new $tw.utils.TwitterArchivistSourceNodeJs({
archivePath: archivePath
}),
archivist = new $tw.utils.TwitterArchivist({
source: archiveSource
});
archivist.loadArchive({
wiki: this.commander.wiki
}).then(function() {
self.callback(null);
}).catch(function(err) {
self.callback(err);
});
return null;
};
exports.Command = Command;