mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-11 12:40:22 +00:00
* remove blks first try * dprint.json seems to be OK, some forgotten functions * add some more space-after-keyword settings * server remove blks * add **/files to dprint exclude * dprint.js fixes a typo * add boot.js and bootprefix.js to dprint exclude * dprint change dprint.json * add dprint fmt as script * remove jslint comments * fix whitespace * fix whitespace * remove function-wrapper from geospatial plugin * fix whitespace * add function wrapper to dyannotate-startup * remove dpring.json
49 lines
1013 B
JavaScript
49 lines
1013 B
JavaScript
/*\
|
|
title: $:/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js
|
|
type: application/javascript
|
|
module-type: command
|
|
|
|
Read tiddlers from an unzipped Twitter archive
|
|
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
var widget = require("$:/core/modules/widgets/widget.js");
|
|
|
|
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;
|