Commit 1cfefc0b authored by Iván Sánchez Ortega's avatar Iván Sánchez Ortega

Update rollup; write debug files for twitter config/ratelimits

parent 68af74be
......@@ -25,7 +25,7 @@
"build": "rollup -c rollup-config.js"
},
"devDependencies": {
"rollup": "^0.41.6",
"rollup": "^0.51.5",
"rollup-plugin-buble": "^0.15.0"
},
"bin": "dist/soclial.js"
......
......@@ -4,15 +4,31 @@
export default {
entry: 'src/soclial.js',
dest: 'dist/soclial.js',
format: 'cjs',
sourceMap: true,
plugins: [
input: 'src/soclial.js',
output: {
file: 'dist/soclial.js',
format: 'cjs',
sourcemap: true,
},
plugins: [
// require('rollup-plugin-string')({ extensions: ['.glsl'] }),
require('rollup-plugin-buble')(),
// require('rollup-plugin-commonjs')(),
// require('rollup-plugin-node-resolve')()
]
],
external: [
'inquirer',
'oauth',
'chalk256',
'mastodon-api',
'striptags',
'he',
'twitter',
'vorpal',
'configstore',
'flatten-obj',
'tinyqueue',
'url-regex'
]
};
// import stringify from 'json-stringify-safe';
import fs from 'fs';
let lastId = 0;
let fs = require('fs');
if (fs.accessSync('debug/')) {
fs.mkdir('debug/');
......
......@@ -8,6 +8,7 @@ import chalk from 'chalk256';
import Twitter from 'twitter';
// import striptags from 'striptags';
// import he from 'he';
import fs from 'fs';
const soclialConsumerKey = 'xiUNN9g7K8it8QIXcA';
const soclialConsumerSecret = 'qsFwbc6gXtcHAplAXjfoKXu96hVXz82W7sEbzuLR2U';
......@@ -156,6 +157,16 @@ class TwitterAccount extends Account {
this._tw.get('help/configuration', {}, (err, json)=>{
if (err) { return vorpal.log(chalk.red(err)); }
this._lenghtOfTCoLinks = json.short_url_length_https;
fs.writeFile('debug/twitter-config.json', JSON.stringify(json, null, ' '), (err)=>{
if (err) {
this._vorpal.log(
chalk.purple('>>> Could not write debug twitter config: '),
chalk.red(err)
);
}
});
return vorpal.log(
chalk.purple('>>> Length of t.co links in the twitter platform is currently: '),
chalk.cyan(this._lenghtOfTCoLinks)
......@@ -390,6 +401,17 @@ class TwitterAccount extends Account {
_refreshRateLimits() {
return this._getEndpointPromise('application/rate_limit_status').then((rateLimits=>{
this._rateLimits = rateLimits;
fs.writeFile('debug/twitter-ratelimits.json', JSON.stringify(rateLimits, null, ' '), (err)=>{
if (err) {
this._vorpal.log(
chalk.purple('>>> Could not write debug ratelimits: '),
chalk.red(err)
);
}
});
// this._vorpal.log(
// chalk.purple('>>> Rate limits for rate limits: '),
// chalk.cyan(rateLimits.resources.application['/application/rate_limit_status'])
......
......@@ -1363,11 +1363,9 @@ rollup-pluginutils@^1.5.0:
estree-walker "^0.2.1"
minimatch "^3.0.2"
rollup@^0.41.6:
version "0.41.6"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a"
dependencies:
source-map-support "^0.4.0"
rollup@^0.51.5:
version "0.51.5"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.51.5.tgz#5caf9101fcaefe344065701ece7de697631a8035"
run-async@^0.1.0:
version "0.1.0"
......@@ -1419,16 +1417,6 @@ sntp@1.x.x:
dependencies:
hoek "2.x.x"
source-map-support@^0.4.0:
version "0.4.14"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef"
dependencies:
source-map "^0.5.6"
source-map@^0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
sparkles@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment