From d3dc65a4faa7736877eb93bb1de757c0b226cf68 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sat, 6 Apr 2019 18:48:47 +0200 Subject: [PATCH 01/11] pls --- server/nightr/strategies/just_eat.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/nightr/strategies/just_eat.py b/server/nightr/strategies/just_eat.py index 64ac646..eba6193 100644 --- a/server/nightr/strategies/just_eat.py +++ b/server/nightr/strategies/just_eat.py @@ -1,11 +1,17 @@ import requests from bs4 import BeautifulSoup +from datetime import datetime, timedelta +import requests_cache + +requests_cache.install_cache("requests_cache", expire_after=timedelta(minutes=10)) def is_restaurant_open(name): - r = requests.get("https://www.just-eat.dk/area/8000-%C3%A5rhusc") + headers = { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'} + r = requests.get("https://www.just-eat.dk/area/8000-århusc") soup = BeautifulSoup(r.content, features='html5lib') + print(soup.prettify()) + print(soup.find('div', {'class': 'listing-group'})) - print(soup.find('div', {'data-test-id': 'listingGroupOpen'})) - -is_restaurant_open("stop2shop") \ No newline at end of file +is_restaurant_open("lel") \ No newline at end of file From ef1884445af70ad1f69112fa9b8a36059446b4fd Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sat, 6 Apr 2019 18:54:49 +0200 Subject: [PATCH 02/11] pls --- server/nightr/strategies/just_eat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/nightr/strategies/just_eat.py b/server/nightr/strategies/just_eat.py index eba6193..1c31e49 100644 --- a/server/nightr/strategies/just_eat.py +++ b/server/nightr/strategies/just_eat.py @@ -9,7 +9,7 @@ requests_cache.install_cache("requests_cache", expire_after=timedelta(minutes=10 def is_restaurant_open(name): headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'} - r = requests.get("https://www.just-eat.dk/area/8000-århusc") + r = requests.get("https://www.just-eat.dk/area/8000-århusc", headers=headers) soup = BeautifulSoup(r.content, features='html5lib') print(soup.prettify()) print(soup.find('div', {'class': 'listing-group'})) From e2c7880ca29a1104f64ecff3d06473d2e6de2f2d Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 19:11:40 +0200 Subject: [PATCH 03/11] Print. --- server/nightr/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/nightr/app.py b/server/nightr/app.py index f1f534e..07842cd 100644 --- a/server/nightr/app.py +++ b/server/nightr/app.py @@ -34,9 +34,11 @@ strategies = { @app.route("/", methods=["GET", "POST"]) def probabilities(): + if request.method == 'GET': + logger.warning("GET request: using default context parameters") phone_data = request.get_json(force=True) - context = Context(**phone_data) logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2)) + context = Context(**phone_data) logger.debug("Context: %s", context) predictions: List[dict] = [] From 55977d9dc4debc869d2a10eb6946f305fd64881f Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 19:22:48 +0200 Subject: [PATCH 04/11] [data] --- server/nightr/app.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/nightr/app.py b/server/nightr/app.py index 07842cd..7ba6a99 100644 --- a/server/nightr/app.py +++ b/server/nightr/app.py @@ -34,11 +34,14 @@ strategies = { @app.route("/", methods=["GET", "POST"]) def probabilities(): - if request.method == 'GET': + if request.method == "GET": logger.warning("GET request: using default context parameters") - phone_data = request.get_json(force=True) - logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2)) - context = Context(**phone_data) + context = Context() + else: + phone_data = request.get_json(force=True) + logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2)) + context = Context(**phone_data["data"]) + logger.debug("Context: %s", context) predictions: List[dict] = [] From d65ea171d8231c14ac62e27cdedf5fca781e4c13 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 19:45:38 +0200 Subject: [PATCH 05/11] Image. --- server/nightr/app.py | 5 +++-- server/nightr/strategies/miloStrats.py | 9 +++------ server/nightr/util.py | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/server/nightr/app.py b/server/nightr/app.py index 7ba6a99..3eecf5e 100644 --- a/server/nightr/app.py +++ b/server/nightr/app.py @@ -42,15 +42,16 @@ def probabilities(): logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2)) context = Context(**phone_data["data"]) - logger.debug("Context: %s", context) + #logger.debug("Context: %s", context) predictions: List[dict] = [] for name, strategy in strategies.items(): try: + logger.debug("Executing %s..", name) start = timeit.default_timer() prediction = strategy(context) stop = timeit.default_timer() - logger.debug("Execution time for %s: %ss", name, stop - start) + logger.debug("Execution time for %s: %ss", name, round(stop - start, 3 )) except Exception as e: logger.warning("Strategy '%s' failed:", name) logger.exception(e) diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index 593c981..3fc4c43 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -1,8 +1,6 @@ from datetime import datetime -from pathlib import Path -import requests -import cv2 +import requests from pytz import timezone from ..util import Context, Prediction @@ -12,12 +10,11 @@ def camImgStrat(context : Context) -> Prediction: """ The contents of the camera image """ - img = cv2.imread(str(Path(__file__).parent.joinpath("night.jpg")), 0) + img = context.image average = img.mean(axis=0).mean(axis=0) p = Prediction() p.weight = 0.7 - - if average < 100: + if average < 100: p.probability = 1.0 p.reasons.append('Image was dark') else: diff --git a/server/nightr/util.py b/server/nightr/util.py index 5b2bc3c..ce7d143 100644 --- a/server/nightr/util.py +++ b/server/nightr/util.py @@ -1,16 +1,30 @@ +import base64 from dataclasses import dataclass, field +from pathlib import Path from typing import List, Dict +import cv2 +import numpy as np + @dataclass class Context: battery: float = 1.0 position: Dict[str, float] = field(default_factory=lambda: {'latitude': 53.0, 'longitude': 9.0}) + image: np.ndarray = None # App settings in_australia: bool = False flat_earth: bool = False + def __post_init__(self): + if self.image is None: # no image given + self.image = cv2.imread(str(Path(__file__).parent.joinpath("gray.png"))) + else: + img_original = base64.b64decode(self.image) + img_as_np = np.frombuffer(img_original, dtype=np.uint8) + self.image = cv2.imdecode(img_as_np, flags=1) + @dataclass class Prediction: From 253c3762c58d5a95ade836e0cbe647eca52ce85a Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 19:47:02 +0200 Subject: [PATCH 06/11] fuck jeg er god --- server/nightr/gray.png | Bin 0 -> 155 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 server/nightr/gray.png diff --git a/server/nightr/gray.png b/server/nightr/gray.png new file mode 100644 index 0000000000000000000000000000000000000000..0a0f09ff00737f2010f4fe8335fd83761c7bd297 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V6Od#Ih{XE z)7O>#F$S|xv6<249-QVi6yBi3gww484B*6z5(HleBwYw vqMj~}ArhC9b22g#4)D&9_|P;_i Date: Sat, 6 Apr 2019 19:51:57 +0200 Subject: [PATCH 07/11] fixed cam img strat --- server/nightr/strategies/miloStrats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index 3fc4c43..3d03666 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -11,7 +11,8 @@ def camImgStrat(context : Context) -> Prediction: The contents of the camera image """ img = context.image - average = img.mean(axis=0).mean(axis=0) + average = img.mean() + print(img.mean()) p = Prediction() p.weight = 0.7 if average < 100: From 565e83d92f6ca5378a46b3092fc82bf3e77ac959 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sat, 6 Apr 2019 19:53:26 +0200 Subject: [PATCH 08/11] Just eat strat --- server/nightr/strategies/just_eat.py | 36 +++++++++++++++++++++++--- server/nightr/strategies/tide_strat.py | 2 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/server/nightr/strategies/just_eat.py b/server/nightr/strategies/just_eat.py index 1c31e49..4376958 100644 --- a/server/nightr/strategies/just_eat.py +++ b/server/nightr/strategies/just_eat.py @@ -3,15 +3,43 @@ from bs4 import BeautifulSoup from datetime import datetime, timedelta import requests_cache +from ..util import Context, Prediction + requests_cache.install_cache("requests_cache", expire_after=timedelta(minutes=10)) -def is_restaurant_open(name): +def is_restaurant_open(name, open, close) -> Prediction: + p = Prediction() + headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'} r = requests.get("https://www.just-eat.dk/area/8000-århusc", headers=headers) soup = BeautifulSoup(r.content, features='html5lib') - print(soup.prettify()) - print(soup.find('div', {'class': 'listing-group'})) + listing_groups = soup.find_all('div', {'class': 'listing-group'}) -is_restaurant_open("lel") \ No newline at end of file + p.reasons.append("Hopefully we are not banned from Just-eat ..") + + nice_group = None + for x in listing_groups: + if x['data-test-id'] == 'listingGroupOpen': + nice_group = x + + if nice_group is None: + p.reasons.append("Apparently we are banned from just-eat. We therefore have no clue.") + p.probability = 0.5 + return p + + all_listings = nice_group.find_all('a', {'class': 'mediaElement'}) + + if any(name in x['href'] for x in all_listings): + p.reasons.append(f"{name} is currently open. We conclude from this, that there is {1 / 11}% chance of it being night outside!") + p.probability = 1 / 11 + else: + p.reasons.append(f"{name} is not open. We can conclude from this, that there is {1 - (1/11)}% chance of it currently being night outside! ") + p.probability = 1 - (1 / 11) + + return p + + +def do_just_eat_strat(context: Context) -> Prediction: + return is_restaurant_open('stop2shop', 12, 23) diff --git a/server/nightr/strategies/tide_strat.py b/server/nightr/strategies/tide_strat.py index 2b48c4f..b73f450 100644 --- a/server/nightr/strategies/tide_strat.py +++ b/server/nightr/strategies/tide_strat.py @@ -50,7 +50,7 @@ def is_tide(context: Context) -> Prediction: if last_match[1] < 0 and last_match[1] < current_water_level: # Increasing time = last_match while time[1] != current_water_level: - + time[0] += average_delta time[1] += 1 From c3d98f15ed006edde9355f6df33b8a022f7dbe59 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 19:55:49 +0200 Subject: [PATCH 09/11] Battery is int. --- server/nightr/strategies/miloStrats.py | 1 - server/nightr/util.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index 3d03666..a6aee42 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -12,7 +12,6 @@ def camImgStrat(context : Context) -> Prediction: """ img = context.image average = img.mean() - print(img.mean()) p = Prediction() p.weight = 0.7 if average < 100: diff --git a/server/nightr/util.py b/server/nightr/util.py index ce7d143..6c70643 100644 --- a/server/nightr/util.py +++ b/server/nightr/util.py @@ -9,7 +9,7 @@ import numpy as np @dataclass class Context: - battery: float = 1.0 + battery: int = 100 position: Dict[str, float] = field(default_factory=lambda: {'latitude': 53.0, 'longitude': 9.0}) image: np.ndarray = None From de299f61ead009a8f87c2989150332bb062706e7 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 20:21:52 +0200 Subject: [PATCH 10/11] Bing --- server/nightr/app.py | 3 ++- server/nightr/strategies/bing.py | 34 ++++++++++++++++++++++++++ server/nightr/strategies/iss.py | 2 +- server/nightr/strategies/miloStrats.py | 5 +++- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 server/nightr/strategies/bing.py diff --git a/server/nightr/app.py b/server/nightr/app.py index 3eecf5e..b8f788b 100644 --- a/server/nightr/app.py +++ b/server/nightr/app.py @@ -10,7 +10,7 @@ from typing import List import requests_cache from flask import Flask, jsonify, logging, request -from .strategies import miloStrats, iss, cars_in_traffic, tide_strat, upstairs_neighbour +from .strategies import miloStrats, iss, cars_in_traffic, tide_strat, upstairs_neighbour, bing from .util import Context app = Flask(__name__) @@ -29,6 +29,7 @@ strategies = { "cars_in_traffic": cars_in_traffic.cars_in_traffic, "tide": tide_strat.is_tide, "upstairs_neighbour": upstairs_neighbour.check_games, + "bing": bing.clock, } diff --git a/server/nightr/strategies/bing.py b/server/nightr/strategies/bing.py new file mode 100644 index 0000000..95d7064 --- /dev/null +++ b/server/nightr/strategies/bing.py @@ -0,0 +1,34 @@ +from datetime import datetime + +import requests +from bs4 import BeautifulSoup + +from ..util import Context, Prediction + + +def clock(context: Context) -> Prediction: + """ + It's nighttime if Bing says it's daytime. + """ + p = Prediction() + p.weight = 0.5 + + headers = { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'} + r = requests.get("https://www.bing.com/search?q=time+in+denmark", headers=headers) + soup = BeautifulSoup(r.content, features='html5lib') + time_str = soup.find("div", {"id": "digit_time"}).text + + time = datetime.strptime(time_str, "%H:%M") + night = time.hour < 6 or time.hour >= 22 + + time_description = "" if night else "daytime" + time_description_oppersite = "daytime" if night else "nighttime" + + p.reasons.append(f"Bing says its {time_description}.") + p.reasons.append(f"We don't really trust it.") + p.reasons.append(f"Let's guess its {time_description_oppersite}.") + + p.probability = 1 - p.probability + + return p diff --git a/server/nightr/strategies/iss.py b/server/nightr/strategies/iss.py index e4ca5de..64b308a 100644 --- a/server/nightr/strategies/iss.py +++ b/server/nightr/strategies/iss.py @@ -48,7 +48,7 @@ def night_on_iss(context: Context) -> Prediction: break iss_time = datetime.now(pytz.timezone(iss_tz)) - iss_night = 6 < iss_time.hour > 22 + iss_night = iss_time.hour < 6 or iss_time.hour >= 22 # iss_night on_iss_time night # 0 0 1 diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index a6aee42..d0418f7 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -40,7 +40,11 @@ def australiaStrat(context : Context) -> Prediction: p.reasons.append('It\'s day-time in Australia') return p + def tv2newsStrat(context : Context) -> Prediction: + """ + The number of articles releases in the last few hours on TV2.dk + """ r = requests.get('http://mpx.services.tv2.dk/api/latest') data = r.json() publish_dates = [(x['pubDate'])//1000 for x in data][:10] @@ -61,4 +65,3 @@ def tv2newsStrat(context : Context) -> Prediction: p.probability = 1.0 if avg_timestamp > 50 else 0.0 p.reasons.append('There were ' + ('few' if avg_timestamp > 50 else 'many') + ' recent articles on TV2 News') return p - From 8826d7764725a68e4a198d1aea24db81ec353d4e Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 6 Apr 2019 20:26:10 +0200 Subject: [PATCH 11/11] Added camera service and button --- client/Nightr/package-lock.json | 8 +++++ client/Nightr/package.json | 1 + client/Nightr/src/app/app.component.html | 5 +-- client/Nightr/src/app/app.module.ts | 2 ++ .../camera-button/camera-button.component.css | 1 + .../camera-button.component.html | 1 + .../camera-button/camera-button.component.ts | 25 +++++++++++++ .../src/app/services/my-camera-service.ts | 35 +++++++++++++++++++ .../app/services/my-geo-location.service.ts | 1 - client/Nightr/src/main.js | 2 +- 10 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 client/Nightr/src/app/component/camera-button/camera-button.component.css create mode 100644 client/Nightr/src/app/component/camera-button/camera-button.component.html create mode 100644 client/Nightr/src/app/component/camera-button/camera-button.component.ts create mode 100644 client/Nightr/src/app/services/my-camera-service.ts diff --git a/client/Nightr/package-lock.json b/client/Nightr/package-lock.json index 04b5e41..1469775 100644 --- a/client/Nightr/package-lock.json +++ b/client/Nightr/package-lock.json @@ -3776,6 +3776,14 @@ "reflect-metadata": "^0.1.8" } }, + "nativescript-camera": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/nativescript-camera/-/nativescript-camera-4.4.0.tgz", + "integrity": "sha512-9Snw/IGjw8cVN1nOwkhQko/x/D2thcd6FZT98k9bstvCHwdBBdmLtGGcHCm4SN0k3MSgvbghs8iaARniZCKO0Q==", + "requires": { + "nativescript-permissions": "^1.2.3" + } + }, "nativescript-dev-typescript": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/nativescript-dev-typescript/-/nativescript-dev-typescript-0.9.0.tgz", diff --git a/client/Nightr/package.json b/client/Nightr/package.json index ddcc97a..36bf9c5 100644 --- a/client/Nightr/package.json +++ b/client/Nightr/package.json @@ -22,6 +22,7 @@ "@angular/platform-browser-dynamic": "~7.2.0", "@angular/router": "~7.2.0", "nativescript-angular": "~7.2.0", + "nativescript-camera": "^4.4.0", "nativescript-geolocation": "^5.0.0", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.12", diff --git a/client/Nightr/src/app/app.component.html b/client/Nightr/src/app/app.component.html index 97b4fff..8de10bd 100644 --- a/client/Nightr/src/app/app.component.html +++ b/client/Nightr/src/app/app.component.html @@ -4,8 +4,9 @@ - + - + + diff --git a/client/Nightr/src/app/app.module.ts b/client/Nightr/src/app/app.module.ts index aefc8e2..04ef01a 100644 --- a/client/Nightr/src/app/app.module.ts +++ b/client/Nightr/src/app/app.module.ts @@ -5,6 +5,7 @@ import { AppComponent } from "./app.component"; import { MyButtonComponent } from './component/my-button/my-button.component'; import { NativeScriptHttpClientModule } from "nativescript-angular/http-client"; import { MyLocationButtonComponent } from './component/locationButton/locationButton.component'; +import { CameraButtonComponent } from './component/camera-button/camera-button.component'; // Uncomment and add to NgModule imports if you need to use two-way binding // import { NativeScriptFormsModule } from "nativescript-angular/forms"; @@ -24,6 +25,7 @@ import { MyLocationButtonComponent } from './component/locationButton/locationBu AppComponent, MyLocationButtonComponent, MyButtonComponent, + CameraButtonComponent, ], providers: [], schemas: [ diff --git a/client/Nightr/src/app/component/camera-button/camera-button.component.css b/client/Nightr/src/app/component/camera-button/camera-button.component.css new file mode 100644 index 0000000..bcd4764 --- /dev/null +++ b/client/Nightr/src/app/component/camera-button/camera-button.component.css @@ -0,0 +1 @@ +/* Add mobile styles for the component here. */ diff --git a/client/Nightr/src/app/component/camera-button/camera-button.component.html b/client/Nightr/src/app/component/camera-button/camera-button.component.html new file mode 100644 index 0000000..4fe4caf --- /dev/null +++ b/client/Nightr/src/app/component/camera-button/camera-button.component.html @@ -0,0 +1 @@ + diff --git a/client/Nightr/src/app/component/camera-button/camera-button.component.ts b/client/Nightr/src/app/component/camera-button/camera-button.component.ts new file mode 100644 index 0000000..bd916ef --- /dev/null +++ b/client/Nightr/src/app/component/camera-button/camera-button.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; +import { MyCameraService } from '../../services/my-camera-service'; +import { Image } from 'tns-core-modules/ui/image' + +@Component({ + selector: 'ns-camera-button', + templateUrl: './camera-button.component.html', + styleUrls: ['./camera-button.component.css'], + moduleId: module.id, +}) +export class CameraButtonComponent implements OnInit { + + camera:MyCameraService = new MyCameraService(); + constructor() { } + + ngOnInit() { + } + + onTap() { + this.camera.takePicture().then( + (res) => {console.log(res)}, () => {} + ); +} + +} diff --git a/client/Nightr/src/app/services/my-camera-service.ts b/client/Nightr/src/app/services/my-camera-service.ts new file mode 100644 index 0000000..a6a4f14 --- /dev/null +++ b/client/Nightr/src/app/services/my-camera-service.ts @@ -0,0 +1,35 @@ +import { Injectable } from '@angular/core'; +import * as camera from 'nativescript-camera'; +import { ImageSource } from 'tns-core-modules/image-source/image-source'; + +@Injectable({ + providedIn: 'root' +}) +export class MyCameraService { + + constructor() { } + + takePicture(): Promise { + var result = new Promise((resolve, reject) => { + camera.requestPermissions(). + then( + () => { + camera.takePicture().then( + (imageAsset) => { + var src = new ImageSource(); + src.fromAsset(imageAsset).then( + (source) => { + resolve(source.toBase64String("png", 75)); + alert("Image uploaded"); + } + ); + } + ).catch((error) => alert(error.message)); + }, () => { + alert("Request rejected"); + } + ).catch(); + }); + return result; + } +} diff --git a/client/Nightr/src/app/services/my-geo-location.service.ts b/client/Nightr/src/app/services/my-geo-location.service.ts index 4de390a..fa658b8 100644 --- a/client/Nightr/src/app/services/my-geo-location.service.ts +++ b/client/Nightr/src/app/services/my-geo-location.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import { isEnabled, enableLocationRequest, getCurrentLocation, watchLocation, distance, clearWatch, Location } from "nativescript-geolocation"; -import { stringify } from '@angular/core/src/render3/util'; @Injectable({ providedIn: 'root' diff --git a/client/Nightr/src/main.js b/client/Nightr/src/main.js index faf70ce..d07591d 100644 --- a/client/Nightr/src/main.js +++ b/client/Nightr/src/main.js @@ -11,4 +11,4 @@ var app_module_1 = require("./app/app.module"); // so we provide a wrapper platform object, platformNativeScriptDynamic, // that sets up a NativeScript application and can bootstrap the Angular framework. platform_1.platformNativeScriptDynamic().bootstrapModule(app_module_1.AppModule); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm1haW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwR0FBMEc7QUFDMUcsMERBQTRFO0FBRTVFLCtDQUE2QztBQUU3QyxnRkFBZ0Y7QUFDaEYsMEVBQTBFO0FBQzFFLHNFQUFzRTtBQUN0RSx5REFBeUQ7QUFDekQseUVBQXlFO0FBQ3pFLHdFQUF3RTtBQUN4RSxtRkFBbUY7QUFDbkYsc0NBQTJCLEVBQUUsQ0FBQyxlQUFlLENBQUMsc0JBQVMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gdGhpcyBpbXBvcnQgc2hvdWxkIGJlIGZpcnN0IGluIG9yZGVyIHRvIGxvYWQgc29tZSByZXF1aXJlZCBzZXR0aW5ncyAobGlrZSBnbG9iYWxzIGFuZCByZWZsZWN0LW1ldGFkYXRhKVxyXG5pbXBvcnQgeyBwbGF0Zm9ybU5hdGl2ZVNjcmlwdER5bmFtaWMgfSBmcm9tIFwibmF0aXZlc2NyaXB0LWFuZ3VsYXIvcGx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