Commit 28df723c authored by Iván Sánchez Ortega's avatar Iván Sánchez Ortega

Replace get-urls with url-regex, because of https://github.com/sindresorhus/normalize-url/pull/48

parent 972a9fed
......@@ -11,7 +11,6 @@
"configstore": "^3.0.0",
"deshortify": "^0.1.2",
"flatten-obj": "^3.1.0",
"get-urls": "^7.0.0",
"he": "^1.1.1",
"inquirer": "^3.0.6",
"json-stringify-safe": "^5.0.1",
......@@ -20,6 +19,7 @@
"striptags": "^3.0.1",
"tinyqueue": "^1.2.2",
"twitter": "^1.7.0",
"url-regex": "^4.1.1",
"vorpal": "^1.11.4"
},
"scripts": {
......
......@@ -9,8 +9,9 @@
// Filters will be chained together by the soclial core, passed as parameters
// to itemPromise.then(...). This allows for both sync and async filters.
import urlRegexFn from 'url-regex';
const urlRegex = urlRegexFn(); // For some reason the module exports a function
import getUrls from 'get-urls';
// import { extract } from 'article-parser';
import Deshortifier from '../../node_modules/deshortify/src/deshortify'
// import Deshortifier from '../../../deshortify/src/deshortify'
......@@ -26,7 +27,9 @@ export default function deshortify(item) {
// This filter takes the text in the item, finds the URLs, and deshortifies them.
let urls = getUrls(item.str);
let urls = item.str.match(urlRegex);
if (!urls) { return item; }
item._deshortifyOriginalUrls = urls;
// console.log('Detected URLs:', urls);
......@@ -39,7 +42,7 @@ export default function deshortify(item) {
let ownItemPromise = Promise.all(ownUrlPromises).then( resolvedUrls=>{
item._deshortifyResolvedUrls = urls;
item._deshortifyResolvedUrls = resolvedUrls;
// console.log(resolvedUrls);
resolvedUrls.forEach(([original, replacement])=>{
......@@ -54,7 +57,7 @@ export default function deshortify(item) {
// Does this item echo another? Then deshortify its URLs too.
if (item.echoed) {
// console.log('Deshortifying also: ', item.echoed);
// console.log('Deshortifying also: ', item.echoed);
let echoedItemPromise = deshortify(item.echoed);
ownItemPromise = Promise.all([ownItemPromise, echoedItemPromise]).then(([own, echoed])=>{
......
......@@ -604,13 +604,6 @@ generate-object-property@^1.1.0:
dependencies:
is-property "^1.0.0"
get-urls@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/get-urls/-/get-urls-7.0.0.tgz#c480adc7d4c6cc5cbb64b531823dc63b99ec1e5a"
dependencies:
normalize-url "^1.3.0"
url-regex "^4.0.0"
getpass@^0.1.1:
version "0.1.6"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6"
......@@ -865,10 +858,6 @@ is-path-inside@^1.0.0:
dependencies:
path-is-inside "^1.0.1"
is-plain-obj@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
is-promise@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
......@@ -1140,15 +1129,6 @@ node-localstorage@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-0.6.0.tgz#45a0601c6932dfde6644a23361f1be173c75d3af"
normalize-url@^1.3.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c"
dependencies:
object-assign "^4.0.1"
prepend-http "^1.0.0"
query-string "^4.1.0"
sort-keys "^1.0.0"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
......@@ -1242,10 +1222,6 @@ prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
prepend-http@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
......@@ -1262,13 +1238,6 @@ qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
query-string@^4.1.0:
version "4.3.4"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb"
dependencies:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2:
version "2.2.9"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8"
......@@ -1450,12 +1419,6 @@ sntp@1.x.x:
dependencies:
hoek "2.x.x"
sort-keys@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad"
dependencies:
is-plain-obj "^1.0.0"
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"
......@@ -1489,10 +1452,6 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
......@@ -1584,6 +1543,10 @@ tinyqueue@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-1.2.2.tgz#947229e5e4197aba988acd27751dcc582e6728ff"
tlds@^1.187.0:
version "1.189.0"
resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.189.0.tgz#b8cb46ea76dc2f4a01d45b8d907bf19a66e9f729"
tmp@^0.0.31:
version "0.0.31"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"
......@@ -1633,11 +1596,12 @@ unique-string@^1.0.0:
dependencies:
crypto-random-string "^1.0.0"
url-regex@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/url-regex/-/url-regex-4.0.0.tgz#eb48fbaf380fbf4c952c76ebd2d2ce00f9b4ca32"
url-regex@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/url-regex/-/url-regex-4.1.1.tgz#a5617b22e15e26dac57ce74c3f52088bcdfec995"
dependencies:
ip-regex "^1.0.1"
tlds "^1.187.0"
user-home@^2.0.0:
version "2.0.0"
......
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