summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/check.js5
-rw-r--r--src/scraper/scrape.js3
-rw-r--r--src/web/src/app/app.component.ts3
-rw-r--r--src/web/src/app/film/film.component.ts10
-rw-r--r--src/web/src/app/scrape.service.ts2
-rw-r--r--src/web/src/app/search-bar/search-bar.component.html37
-rw-r--r--src/web/src/assets/img/platforms/cartoonnetwork.pngbin0 -> 1220 bytes
-rw-r--r--src/web/src/assets/img/platforms/nbc.pngbin0 -> 23670 bytes
-rw-r--r--src/web/src/styles.css5
9 files changed, 25 insertions, 40 deletions
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 @@
<form class="example-form">
- <mat-form-field
- style="width: 100%"
- class="example-full-width"
- appearance="outline"
- >
+ <mat-form-field style="width: 100%" class="example-full-width" appearance="outline">
<mat-label style="font-size: x-large">Discover</mat-label>
- <input
- type="text"
- placeholder="Movies / TV Shows"
- aria-label="Number"
- matInput
- [formControl]="myControl"
- [matAutocomplete]="auto"
- />
+ <input type="text" placeholder="Movies / TV Shows" aria-label="Number" matInput [formControl]="myControl"
+ [matAutocomplete]="auto" />
<mat-icon matSuffix>search</mat-icon>
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
- <mat-option
- class="is-loading"
- *ngIf="isLoading && hasItems && !isEmpty"
- >
+ <mat-option class="is-loading" *ngIf="isLoading && hasItems && !isEmpty">
<mat-spinner [color]="color" diameter="50"></mat-spinner>
</mat-option>
<mat-option *ngIf="!hasItems && !isEmpty">
- No Movies found
+ No movies found
</mat-option>
<ng-container *ngIf="!isLoading && hasItems">
- <mat-option
- *ngFor="let option of options"
- [value]="option.original_title"
- >
- <app-search-item
- (click)="storeData(option)"
- [model]="option"
- [routerLink]="['', option.media_type, option.id]"
- ></app-search-item>
+ <mat-option *ngFor="let option of options" [value]="option.original_title">
+ <app-search-item (click)="storeData(option)" [model]="option"
+ [routerLink]="['', option.media_type, option.id]"></app-search-item>
</mat-option>
</ng-container>
</mat-autocomplete>
</mat-form-field>
-</form>
+</form> \ 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
--- /dev/null
+++ b/src/web/src/assets/img/platforms/cartoonnetwork.png
Binary files 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
--- /dev/null
+++ b/src/web/src/assets/img/platforms/nbc.png
Binary files 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;