Comparing version 0.0.61 to 0.0.62
@@ -1,4 +0,3 @@ | ||
var $ = require("cheerio"), | ||
request = require("request") | ||
var impurge = []; | ||
var request = require("request") | ||
var impurge = []; | ||
@@ -17,11 +16,6 @@ module.exports = impurge; | ||
impurge.get_text_imgur_links = function(text) { | ||
var imgur_url_pattern = RegExp("http(s)?://((m)\.|(www)\.|((i)\.))?imgur.com/(a/)?[a-zA-Z0-9&]+((\.jpg)|(\.gif)|(\.png))?", "igm"); | ||
var matches = imgur_url_pattern.exec(text); | ||
var urls = [] | ||
while ((matches = imgur_url_pattern.exec(text)) !== null) { | ||
urls.push(matches[0]); | ||
}; | ||
return urls; | ||
console.log(text) | ||
var imgur_url_pattern = RegExp("(http)(s)?://((m)\.|(www)\.|((i)\.))?imgur.com/(a/)?[a-zA-Z0-9&]+((\.jpg)|(\.gif)|(\.png))?", "igm"); | ||
var matches = text.match(imgur_url_pattern); | ||
return matches; | ||
} | ||
@@ -28,0 +22,0 @@ |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.0.61", | ||
"version": "0.0.62", | ||
"description": "takes any imgur url and returns an array of direct image files", | ||
@@ -16,5 +16,6 @@ "engines": { | ||
"dependencies": { | ||
"cheerio": "*", | ||
"mocha": "*", | ||
"request": "~2.11.4", | ||
"cheerio": "*" | ||
"reddit-user-dump": "0.0.2", | ||
"request": "~2.11.4" | ||
}, | ||
@@ -21,0 +22,0 @@ "devDependencies": { |
@@ -51,9 +51,26 @@ var request = require('request'); | ||
//this is a test for text it should return 5 links | ||
// var testTextAlbum = 'http://imgur.com/a/o7AVs is a album_url with id: [ o7AVs ] and url undefined '; | ||
// var testTextImage = 'http://i.imgur.com/4aCgHc7.jpg is a image_url with id: null and url http://i.imgur.com/4aCgHc7.jpg '; | ||
// var testTextHash = 'http://i.imgur.com/oM1mFEd.jpg is a hash_url with id: [ oM1mFEd] and url undefined '; | ||
// var testTextAlbum2 = 'http://imgur.com/a/h4gt1 is a album_url with id: [ h4gt1 ] and url undefined'; | ||
// var testText = testTextAlbum + testTextImage + testTextHash + testTextAlbum2; | ||
// console.log(testText); | ||
// var comment_links = impurge.get_text_imgur_links(testText); | ||
var testUserObj = {}; | ||
var buffer = []; | ||
var scrape = require('reddit-user-dump'); //this sets up the user objects for parsing | ||
scrape('test_predditor') | ||
.on('user', function(userObj) { | ||
testUserObj = userObj; | ||
}).on('data', function(post) { | ||
buffer.push(post) | ||
}) | ||
.on('submission', function(submission) { | ||
testSubmission = submission.data; | ||
}) | ||
.on('comment', function(comment) { | ||
parseComment(comment.data) | ||
}) | ||
.on('end', function() { | ||
}) | ||
function parseComment(comment) { | ||
//console.log(comment.body_html) | ||
console.log(impurge.get_text_imgur_links(comment.body + ' ' + comment.body)); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160
8084
4
+ Addedreddit-user-dump@0.0.2
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmeasured@0.1.6(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.13.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedreddit-user-dump@0.0.2(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)