summaryrefslogtreecommitdiff
path: root/src/check.js
diff options
context:
space:
mode:
authorFivePixels <37427166+FivePixels@users.noreply.github.com>2021-04-10 14:21:09 -0500
committerGitHub <noreply@github.com>2021-04-10 14:21:09 -0500
commitd3d9f7e6b69a84ea4da04609642f309134f0a346 (patch)
tree3f9f06658cec910f7421765535f85937ba7f2507 /src/check.js
parent1b768b65ce2f241dfdaa0497bd79e593baec9a77 (diff)
parent034720cdad9e7344db4177a6fef89c6b29a5829a (diff)
downloadStreamFinder-d3d9f7e6b69a84ea4da04609642f309134f0a346.tar.xz
StreamFinder-d3d9f7e6b69a84ea4da04609642f309134f0a346.zip
Merge pull request #2 from FivePixels/dylan
check.js incomplete implementation, move modules to src, export scra…
Diffstat (limited to 'src/check.js')
-rw-r--r--src/check.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/check.js b/src/check.js
index 73c58dd..c7085ca 100644
--- a/src/check.js
+++ b/src/check.js
@@ -1,4 +1,18 @@
-const mongodb = require('mongodb');
+const MongoClient = require('mongodb').MongoClient;
// This is for passing the parameters of the search to check and see if it already exists in the database
-// if it does exist, we're gonna call another function in another file. \ No newline at end of file
+// if it does exist, we're gonna call another function in another file.
+
+const scraper = require('./scraper/scrape')
+
+exports.performCheck = async function performCheck(query, type) {
+ // if (!exist in database) {
+ await scraper.performSearch(query, type);
+ // }
+ // (if it needed to be scraped, it now is, and its stored. next, we perform the database search for the newly saved entry)
+ performDatabaseSearch(query, type);
+}
+
+async function performDatabaseSearch(query, type) {
+ // do database search
+} \ No newline at end of file