Browse Source

:boom: try install puppeteer

LI JIAHAO 6 years ago
parent
commit
b22298dd93
3 changed files with 109 additions and 254 deletions
  1. 3 2
      package.json
  2. 100 91
      src/webshot.ts
  3. 6 161
      yarn.lock

+ 3 - 2
package.json

@@ -28,14 +28,15 @@
     "lint": "tslint --fix -c tslint.json --project ./"
   },
   "dependencies": {
+    "callable-instance": "^1.0.0",
     "command-line-usage": "^5.0.5",
     "cq-websocket": "^1.2.6",
     "log4js": "^2.10.0",
     "pngjs": "^3.3.3",
+    "puppeteer": "^1.5.0",
     "read-all-stream": "^3.1.0",
     "twitter": "^1.7.1",
-    "typescript": "^2.9.2",
-    "webshot": "^0.18.0"
+    "typescript": "^2.9.2"
   },
   "devDependencies": {
     "@types/node": "^10.5.1",

+ 100 - 91
src/webshot.ts

@@ -2,119 +2,128 @@ import * as https from 'https';
 import * as log4js from 'log4js';
 import { PNG } from 'pngjs';
 import * as read from 'read-all-stream';
-import * as webshot from 'webshot';
+import * as CallableInstance from 'callable-instance';
 
 const logger = log4js.getLogger('webshot');
 logger.level = (global as any).loglevel;
 
-function renderWebshot(url: string, height: number, webshotDelay: number): Promise<string> {
-  const promise = new Promise<{ data: string, boundary: null | number }>(resolve => {
-    const options = {
-      windowSize: {
-        width: 1080,
-        height,
-      },
-      userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36',
-      renderDelay: webshotDelay,
-      quality: 100,
-      customCSS: 'html{zoom:2}header{display:none!important}',
-    };
-    logger.info(`shooting ${options.windowSize.width}*${height} webshot for ${url}`);
-    webshot(url, options).pipe(new PNG({
-      filterType: 4,
-    }))
-      .on('parsed', function () {
-        let boundary = null;
-        let x = 0;
-        for (let y = 0; y < this.height; y++) {
-          const idx = (this.width * y + x) << 2;
-          if (this.data[idx] !== 255) {
-            boundary = y;
-            break;
-          }
-        }
-        if (boundary !== null) {
-          logger.info(`found boundary at ${boundary}, cropping image`);
-          this.data = this.data.slice(0, (this.width * boundary) << 2);
-          this.height = boundary;
+class Webshot extends CallableInstance {
+  constructor() {
+    super('webshot');
+  }
 
-          boundary = null;
-          x = Math.floor(this.width / 2);
-          for (let y = this.height - 1; y >= 0; y--) {
+  private renderWebshot = (url: string, height: number, webshotDelay: number): Promise<string> =>  {
+    const promise = new Promise<{ data: string, boundary: null | number }>(resolve => {
+      const options = {
+        windowSize: {
+          width: 1080,
+          height,
+        },
+        userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36',
+        renderDelay: webshotDelay,
+        quality: 100,
+        customCSS: 'html{zoom:2}header{display:none!important}',
+      };
+      logger.info(`shooting ${options.windowSize.width}*${height} webshot for ${url}`);
+      webshot(url, options).pipe(new PNG({
+        filterType: 4,
+      }))
+        .on('parsed', function () {
+          let boundary = null;
+          let x = 0;
+          for (let y = 0; y < this.height; y++) {
             const idx = (this.width * y + x) << 2;
             if (this.data[idx] !== 255) {
               boundary = y;
               break;
             }
           }
-          if (boundary != null) {
-            logger.info(`found boundary at ${boundary}, trimming image`);
+          if (boundary !== null) {
+            logger.info(`found boundary at ${boundary}, cropping image`);
             this.data = this.data.slice(0, (this.width * boundary) << 2);
             this.height = boundary;
+
+            boundary = null;
+            x = Math.floor(this.width / 2);
+            for (let y = this.height - 1; y >= 0; y--) {
+              const idx = (this.width * y + x) << 2;
+              if (this.data[idx] !== 255) {
+                boundary = y;
+                break;
+              }
+            }
+            if (boundary != null) {
+              logger.info(`found boundary at ${boundary}, trimming image`);
+              this.data = this.data.slice(0, (this.width * boundary) << 2);
+              this.height = boundary;
+            }
+
+            read(this.pack(), 'base64').then(data => {
+              logger.info(`finished webshot for ${url}`);
+              resolve({data, boundary});
+            });
+          } else if (height >= 8 * 1920) {
+            logger.warn('too large, consider as a bug, returning');
+            read(this.pack(), 'base64').then(data => {
+              logger.info(`finished webshot for ${url}`);
+              resolve({data, boundary: 0});
+            });
+          } else {
+            logger.info('unable to found boundary, try shooting a larger image');
+            resolve({data: '', boundary});
           }
+        });
+    });
+    return promise.then(data => {
+      if (data.boundary === null) return this.renderWebshot(url, height + 1920, webshotDelay);
+      else return data.data;
+    });
+  }
 
-          read(this.pack(), 'base64').then(data => {
-            logger.info(`finished webshot for ${url}`);
-            resolve({data, boundary});
-          });
-        } else if (height >= 8 * 1920) {
-          logger.warn('too large, consider as a bug, returning');
-          read(this.pack(), 'base64').then(data => {
-            logger.info(`finished webshot for ${url}`);
-            resolve({data, boundary: 0});
+  private fetchImage = (url: string): Promise<string> => {
+    return new Promise<string>(resolve => {
+      logger.info(`fetching ${url}`);
+      https.get(url, res => {
+        if (res.statusCode === 200) {
+          read(res, 'base64').then(data => {
+            logger.info(`successfully fetched ${url}`);
+            resolve(data);
           });
         } else {
-          logger.info('unable to found boundary, try shooting a larger image');
-          resolve({data: '', boundary});
+          logger.error(`failed to fetch ${url}: ${res.statusCode}`);
+          resolve();
         }
+      }).on('error', (err) => {
+        logger.error(`failed to fetch ${url}: ${err.message}`);
+        resolve();
       });
-  });
-  return promise.then(data => {
-    if (data.boundary === null) return renderWebshot(url, height + 1920, webshotDelay);
-    else return data.data;
-  });
-}
+    });
+  }
 
-function fetchImage(url: string): Promise<string> {
-  return new Promise<string>(resolve => {
-    logger.info(`fetching ${url}`);
-    https.get(url, res => {
-      if (res.statusCode === 200) {
-        read(res, 'base64').then(data => {
-          logger.info(`successfully fetched ${url}`);
-          resolve(data);
+  public webshot = (tweets, callback, webshotDelay: number): Promise<void> => {
+    let promise = new Promise<void>(resolve => {
+      resolve();
+    });
+    tweets.forEach(twi => {
+      let cqstr = '';
+      const url = `https://mobile.twitter.com/${twi.user.screen_name}/status/${twi.id_str}`;
+      promise = promise.then(() => this.renderWebshot(url, 1920, webshotDelay))
+        .then(base64Webshot => {
+          if (base64Webshot) cqstr += `[CQ:image,file=base64://${base64Webshot}]`;
+        });
+      if (twi.extended_entities) {
+        twi.extended_entities.media.forEach(media => {
+          promise = promise.then(() => this.fetchImage(media.media_url_https))
+            .then(base64Image => {
+              if (base64Image) cqstr += `[CQ:image,file=base64://${base64Image}]`;
+            });
         });
-      } else {
-        logger.error(`failed to fetch ${url}: ${res.statusCode}`);
-        resolve();
       }
-    }).on('error', (err) => {
-      logger.error(`failed to fetch ${url}: ${err.message}`);
-      resolve();
+      promise.then(() => callback(cqstr));
     });
-  });
-}
+    return promise;
+  }
 
-export default function (tweets, callback, webshotDelay: number): Promise<void> {
-  let promise = new Promise<void>(resolve => {
-    resolve();
-  });
-  tweets.forEach(twi => {
-    let cqstr = '';
-    const url = `https://mobile.twitter.com/${twi.user.screen_name}/status/${twi.id_str}`;
-    promise = promise.then(() => renderWebshot(url, 1920, webshotDelay))
-      .then(base64Webshot => {
-        if (base64Webshot) cqstr += `[CQ:image,file=base64://${base64Webshot}]`;
-      });
-    if (twi.extended_entities) {
-      twi.extended_entities.media.forEach(media => {
-        promise = promise.then(() => fetchImage(media.media_url_https))
-          .then(base64Image => {
-            if (base64Image) cqstr += `[CQ:image,file=base64://${base64Image}]`;
-          });
-      });
-    }
-    promise.then(() => callback(cqstr));
-  });
-  return promise;
 }
+
+export default Webshot;

+ 6 - 161
yarn.lock

@@ -158,10 +158,6 @@ brace-expansion@^1.1.7:
     balanced-match "^1.0.0"
     concat-map "0.0.1"
 
-buffer-from@^1.0.0:
-  version "1.1.0"
-  resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04"
-
 buffer-more-ints@0.0.2:
   version "0.0.2"
   resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c"
@@ -253,15 +249,6 @@ concat-map@0.0.1:
   version "0.0.1"
   resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
 
-concat-stream@1.6.2:
-  version "1.6.2"
-  resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
-  dependencies:
-    buffer-from "^1.0.0"
-    inherits "^2.0.3"
-    readable-stream "^2.2.2"
-    typedarray "^0.0.6"
-
 core-util-is@1.0.2, core-util-is@~1.0.0:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -273,12 +260,6 @@ cq-websocket@^1.2.6:
     lodash.get "^4.4.2"
     websocket "^1.0.25"
 
-cross-spawn@^0.2.3:
-  version "0.2.9"
-  resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-0.2.9.tgz#bd67f96c07efb6303b7fe94c1e979f88478e0a39"
-  dependencies:
-    lru-cache "^2.5.0"
-
 cryptiles@2.x.x:
   version "2.0.5"
   resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
@@ -299,7 +280,7 @@ date-format@^1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8"
 
-debug@2, debug@2.6.9, debug@^2.2.0:
+debug@2, debug@^2.2.0:
   version "2.6.9"
   resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
   dependencies:
@@ -398,15 +379,6 @@ extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
 
-extract-zip@^1.6.5:
-  version "1.6.7"
-  resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
-  dependencies:
-    concat-stream "1.6.2"
-    debug "2.6.9"
-    mkdirp "0.5.1"
-    yauzl "2.4.1"
-
 extsprintf@1.3.0:
   version "1.3.0"
   resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
@@ -427,12 +399,6 @@ fast-levenshtein@~2.0.4:
   version "2.0.6"
   resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
 
-fd-slicer@~1.0.1:
-  version "1.0.1"
-  resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
-  dependencies:
-    pend "~1.2.0"
-
 file-uri-to-path@1:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
@@ -463,14 +429,6 @@ form-data@~2.3.0, form-data@~2.3.1:
     combined-stream "1.0.6"
     mime-types "^2.1.12"
 
-fs-extra@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950"
-  dependencies:
-    graceful-fs "^4.1.2"
-    jsonfile "^2.1.0"
-    klaw "^1.0.0"
-
 fs.realpath@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -520,16 +478,6 @@ glob@^7.1.1:
     once "^1.3.0"
     path-is-absolute "^1.0.0"
 
-graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
-  version "4.1.11"
-  resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
-
-graceful-fs@~3.0.4:
-  version "3.0.11"
-  resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818"
-  dependencies:
-    natives "^1.1.0"
-
 har-schema@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
@@ -560,13 +508,6 @@ has-flag@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
 
-hasha@^2.2.0:
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1"
-  dependencies:
-    is-stream "^1.0.1"
-    pinkie-promise "^2.0.0"
-
 hawk@~3.1.3:
   version "3.1.3"
   resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
@@ -662,7 +603,7 @@ inflight@^1.0.4:
     once "^1.3.0"
     wrappy "1"
 
-inherits@2, inherits@2.0.3, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3:
+inherits@2, inherits@2.0.3, inherits@~2.0.1, inherits@~2.0.3:
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
 
@@ -688,7 +629,7 @@ is-property@^1.0.0:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
 
-is-stream@^1.0.1, is-stream@^1.1.0:
+is-stream@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
 
@@ -704,10 +645,6 @@ isarray@~1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
 
-isexe@^2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
-
 isstream@~0.1.2:
   version "0.1.2"
   resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -739,12 +676,6 @@ json-stringify-safe@5.0.x, json-stringify-safe@~5.0.1:
   version "5.0.1"
   resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
 
-jsonfile@^2.1.0:
-  version "2.4.0"
-  resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
-  optionalDependencies:
-    graceful-fs "^4.1.6"
-
 jsonpointer@^4.0.0:
   version "4.0.1"
   resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
@@ -758,16 +689,6 @@ jsprim@^1.2.2:
     json-schema "0.2.3"
     verror "1.10.0"
 
-kew@^0.7.0:
-  version "0.7.0"
-  resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b"
-
-klaw@^1.0.0:
-  version "1.3.1"
-  resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
-  optionalDependencies:
-    graceful-fs "^4.1.9"
-
 levn@~0.3.0:
   version "0.3.0"
   resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
@@ -830,10 +751,6 @@ loggly@^1.1.0:
     request "2.75.x"
     timespan "2.3.x"
 
-lru-cache@^2.5.0:
-  version "2.7.3"
-  resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
-
 lru-cache@^4.1.2:
   version "4.1.3"
   resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
@@ -882,7 +799,7 @@ minimist@0.0.8:
   version "0.0.8"
   resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
 
-mkdirp@0.5.1, mkdirp@^0.5.1:
+mkdirp@^0.5.1:
   version "0.5.1"
   resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
   dependencies:
@@ -896,10 +813,6 @@ nan@^2.3.3:
   version "2.10.0"
   resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"
 
-natives@^1.1.0:
-  version "1.1.4"
-  resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58"
-
 netmask@^1.0.6:
   version "1.0.6"
   resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35"
@@ -978,10 +891,6 @@ optionator@^0.8.1:
     type-check "~0.3.2"
     wordwrap "~1.0.0"
 
-os-tmpdir@~1.0.2:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
-
 pac-proxy-agent@^2.0.1:
   version "2.0.2"
   resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-2.0.2.tgz#90d9f6730ab0f4d2607dcdcd4d3d641aa26c3896"
@@ -1019,28 +928,10 @@ path-proxy@~1.0.0:
   dependencies:
     inflection "~1.3.0"
 
-pend@~1.2.0:
-  version "1.2.0"
-  resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
-
 performance-now@^2.1.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
 
-phantomjs-prebuilt@^2.1.3:
-  version "2.1.16"
-  resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef"
-  dependencies:
-    es6-promise "^4.0.3"
-    extract-zip "^1.6.5"
-    fs-extra "^1.0.0"
-    hasha "^2.2.0"
-    kew "^0.7.0"
-    progress "^1.1.8"
-    request "^2.81.0"
-    request-progress "^2.0.1"
-    which "^1.2.10"
-
 pinkie-promise@^2.0.0:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
@@ -1067,10 +958,6 @@ process-nextick-args@~2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
 
-progress@^1.1.8:
-  version "1.1.8"
-  resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
-
 promisify-call@^2.0.2:
   version "2.0.4"
   resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba"
@@ -1135,7 +1022,7 @@ readable-stream@1.1.x, "readable-stream@1.x >=1.1.9":
     isarray "0.0.1"
     string_decoder "~0.10.x"
 
-readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.2.2, readable-stream@^2.3.0:
+readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.3.0:
   version "2.3.6"
   resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
   dependencies:
@@ -1178,12 +1065,6 @@ reduce-flatten@^1.0.1:
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-1.0.1.tgz#258c78efd153ddf93cb561237f61184f3696e327"
 
-request-progress@^2.0.1:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08"
-  dependencies:
-    throttleit "^1.0.0"
-
 request@2.75.x:
   version "2.75.0"
   resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93"
@@ -1210,7 +1091,7 @@ request@2.75.x:
     tough-cookie "~2.3.0"
     tunnel-agent "~0.4.1"
 
-request@^2.0.0, request@^2.72.0, request@^2.74.0, request@^2.81.0:
+request@^2.0.0, request@^2.72.0, request@^2.74.0:
   version "2.87.0"
   resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
   dependencies:
@@ -1386,10 +1267,6 @@ table-layout@^0.4.3:
     typical "^2.6.1"
     wordwrapjs "^3.0.0"
 
-throttleit@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c"
-
 thunkify@^2.1.2:
   version "2.1.2"
   resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d"
@@ -1398,12 +1275,6 @@ timespan@2.3.x:
   version "2.3.0"
   resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929"
 
-tmp@~0.0.25:
-  version "0.0.33"
-  resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
-  dependencies:
-    os-tmpdir "~1.0.2"
-
 tough-cookie@~2.3.0, tough-cookie@~2.3.3:
   version "2.3.4"
   resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
@@ -1478,10 +1349,6 @@ typedarray-to-buffer@^3.1.2:
   dependencies:
     is-typedarray "^1.0.0"
 
-typedarray@^0.0.6:
-  version "0.0.6"
-  resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
-
 typescript@^2.9.2:
   version "2.9.2"
   resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
@@ -1514,16 +1381,6 @@ verror@1.10.0:
     core-util-is "1.0.2"
     extsprintf "^1.2.0"
 
-webshot@^0.18.0:
-  version "0.18.0"
-  resolved "https://registry.yarnpkg.com/webshot/-/webshot-0.18.0.tgz#057e6925bc3970ae97eed56fc23118578cbcfdc3"
-  dependencies:
-    cross-spawn "^0.2.3"
-    graceful-fs "~3.0.4"
-    tmp "~0.0.25"
-  optionalDependencies:
-    phantomjs-prebuilt "^2.1.3"
-
 websocket@^1.0.25:
   version "1.0.26"
   resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.26.tgz#a03a01299849c35268c83044aa919c6374be8194"
@@ -1537,12 +1394,6 @@ when@^3.7.7:
   version "3.7.8"
   resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
 
-which@^1.2.10:
-  version "1.3.1"
-  resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
-  dependencies:
-    isexe "^2.0.0"
-
 with-callback@^1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21"
@@ -1577,9 +1428,3 @@ yaeti@^0.0.6:
 yallist@^2.1.2:
   version "2.1.2"
   resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
-
-yauzl@2.4.1:
-  version "2.4.1"
-  resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
-  dependencies:
-    fd-slicer "~1.0.1"