From c8bee5822c7ffbed211e639d21095a0e82d9fe8f Mon Sep 17 00:00:00 2001 From: realS1ant Date: Sun, 11 Apr 2021 11:31:24 -0400 Subject: minor updates --- .gitignore | 3 +- src/check.js | 5 +-- src/scraper/scrape.js | 3 +- src/web/src/app/app.component.ts | 3 +- src/web/src/app/film/film.component.ts | 10 +++--- src/web/src/app/scrape.service.ts | 2 -- .../src/app/search-bar/search-bar.component.html | 37 +++++---------------- .../src/assets/img/platforms/cartoonnetwork.png | Bin 0 -> 1220 bytes src/web/src/assets/img/platforms/nbc.png | Bin 0 -> 23670 bytes src/web/src/styles.css | 5 +++ 10 files changed, 27 insertions(+), 41 deletions(-) create mode 100644 src/web/src/assets/img/platforms/cartoonnetwork.png create mode 100644 src/web/src/assets/img/platforms/nbc.png diff --git a/.gitignore b/.gitignore index 46edad0..604a95d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules .DS_Store src/ecosystem.config.js -src/web/ecosystem.config.js \ No newline at end of file +src/web/ecosystem.config.js +src/.env diff --git a/src/check.js b/src/check.js index 2410e89..c2ef3cd 100644 --- a/src/check.js +++ b/src/check.js @@ -1,4 +1,5 @@ const MongoClient = require('mongodb').MongoClient; +require('dotenv').config(); // This is for passing the parameters of the search to check and see if it already exists in the database @@ -7,7 +8,7 @@ const MongoClient = require('mongodb').MongoClient; const scraper = require('./scraper/scrape') exports.performCheck = async function performCheck(id, query, type) { - const uri = "mongodb+srv://user0:8HL0NBINt6B8mIYF@cluster0.kfyrm.mongodb.net/StreamFinder?retryWrites=true&w=majority"; + const uri = process.env.MONGO_URI; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); var result; @@ -38,7 +39,7 @@ exports.performCheck = async function performCheck(id, query, type) { async function performDatabaseSearch(id, type) { // do database search - const uri = "mongodb+srv://user0:8HL0NBINt6B8mIYF@cluster0.kfyrm.mongodb.net/StreamFinder?retryWrites=true&w=majority"; + const uri = process.env.MONGO_URI; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); var result; await client.connect(); diff --git a/src/scraper/scrape.js b/src/scraper/scrape.js index e6018d2..3d4266f 100644 --- a/src/scraper/scrape.js +++ b/src/scraper/scrape.js @@ -1,5 +1,6 @@ const puppeteer = require('puppeteer'); const MongoClient = require('mongodb').MongoClient; +require('dotenv').config(); // Specifically for scraping // Stores in database once finished scraping @@ -8,7 +9,7 @@ const MongoClient = require('mongodb').MongoClient; exports.performSearch = async function (id, query, type) { try { - const uri = "mongodb+srv://user0:8HL0NBINt6B8mIYF@cluster0.kfyrm.mongodb.net/StreamFinder?retryWrites=true&w=majority"; + const uri = "mongodb+srv://hahaUthought:HhKrH8NbhgrcRScq@cluster0.kfyrm.mongodb.net/StreamFinder?retryWrites=true&w=majority"; const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); await client.connect(); const database = client.db("db"); diff --git a/src/web/src/app/app.component.ts b/src/web/src/app/app.component.ts index fdbd59f..72141a5 100644 --- a/src/web/src/app/app.component.ts +++ b/src/web/src/app/app.component.ts @@ -16,8 +16,7 @@ export class AppComponent implements OnInit { */ constructor(route: Router) { this.routes = route.url; - console.log(this.routes); } - ngOnInit(): void {} + ngOnInit(): void { } } diff --git a/src/web/src/app/film/film.component.ts b/src/web/src/app/film/film.component.ts index f3c002c..4c40295 100644 --- a/src/web/src/app/film/film.component.ts +++ b/src/web/src/app/film/film.component.ts @@ -51,6 +51,9 @@ export class FilmComponent implements OnInit { { name: 'viki', url: 'https://www.viki.com/' }, { name: 'youtube', url: 'https://www.youtube.com/' }, { name: 'youtubetv', url: 'https://tv.youtube.com/' }, + { name: 'vudu', url: 'https://vudu.com/' }, + { name: 'nbc', url: 'https://nbc.com/' }, + { name: 'cartoonnetwork', url: 'https://www.cartoonnetwork.com/video' }, ]; constructor( private route: ActivatedRoute, @@ -88,15 +91,12 @@ export class FilmComponent implements OnInit { } getProviderImage(i: number) { - console.log( - (this.providers[i] as string).toLowerCase().replace(/ /g, '').replace('+', 'plus') - ); return (this.providers[i] as string).toLowerCase().replace(/ /g, '').replace('+', 'plus'); } getLink(i: number) { - let a = (this.providers[i] as string).toLowerCase().replace(/ /g, ''); - let search = this.urls.find((x) => x.name == a); + let a = (this.providers[i] as string).toLowerCase().replace(/ /g, '').replace('+', 'plus'); + let search = this.urls.find(x => x.name == a); if (search == undefined || search == null) { return ''; } else { diff --git a/src/web/src/app/scrape.service.ts b/src/web/src/app/scrape.service.ts index bbde5f3..0c245b2 100644 --- a/src/web/src/app/scrape.service.ts +++ b/src/web/src/app/scrape.service.ts @@ -10,11 +10,9 @@ export class ScrapeService { constructor(private service: HttpClient) { } performCheck(id, query, type) { - console.log('performCheck(...);'); var res = this.service.get(this.apiURL + 'performCheck', { params: { id: id, query: query, type: type }, }); - console.log(res); return res; } } \ No newline at end of file diff --git a/src/web/src/app/search-bar/search-bar.component.html b/src/web/src/app/search-bar/search-bar.component.html index 88d9c1d..422ff51 100644 --- a/src/web/src/app/search-bar/search-bar.component.html +++ b/src/web/src/app/search-bar/search-bar.component.html @@ -1,41 +1,22 @@
- + Discover - + search - + - No Movies found + No movies found - - + + - + \ No newline at end of file diff --git a/src/web/src/assets/img/platforms/cartoonnetwork.png b/src/web/src/assets/img/platforms/cartoonnetwork.png new file mode 100644 index 0000000..7ae15ac Binary files /dev/null and b/src/web/src/assets/img/platforms/cartoonnetwork.png differ diff --git a/src/web/src/assets/img/platforms/nbc.png b/src/web/src/assets/img/platforms/nbc.png new file mode 100644 index 0000000..a654a02 Binary files /dev/null and b/src/web/src/assets/img/platforms/nbc.png differ diff --git a/src/web/src/styles.css b/src/web/src/styles.css index 582bc24..7764a7e 100644 --- a/src/web/src/styles.css +++ b/src/web/src/styles.css @@ -107,6 +107,11 @@ body { margin: 20px auto; } +.card_title { + width: 120px; + text-align: center; +} + .card .card-img { width: inherit; height: inherit; -- cgit v1.2.3