forked from ajaystark/hackercamp19
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef41653
commit 6b4e71b
Showing
18 changed files
with
303 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import flask, json | ||
from Predictor import Predictor | ||
|
||
data = [ | ||
[ | ||
'Bewakoof T-Shirt', | ||
'https://www.bewakoof.com/p/gym-karo-half-sleeve-t-shirt-for-men', | ||
'3/5' | ||
], | ||
[ | ||
'SouledStore T-Shirt', | ||
'thesouledstore.com/product/namaste-bitches-tshirt', | ||
'4/5' | ||
], | ||
[ | ||
'PopXO T-Shirt', | ||
'//www.popxo.com/product/adulting-t-shirt-boyfriend-fit', | ||
'2/5' | ||
], | ||
[ | ||
'TMC Beard Oil', | ||
'//www.themancompany.com/products/almond-thyme-beard-oil?variant=20823289991', | ||
'2.5/5' | ||
], | ||
[ | ||
'Beardo Oil', | ||
'https://www.beardo.in/oil/beardo-beard-hair-growth-oil-for-full-beard', | ||
'3/5' | ||
], | ||
[ | ||
'BMC Oil', | ||
'https://www.amazon.in/Bombay-Shaving-Company-Beard-Growth/dp/B07H83VQ4Z ', | ||
'4/5' | ||
], | ||
[ | ||
'Beardhood Oil', | ||
'//www.amazon.in/Beardhood-Subtle-Citrus-Beard-30ml/dp/B071VPVKG6', | ||
'3.5/5' | ||
], | ||
[ | ||
'Chumbak Laptop Sleeve', | ||
'amazon.in/Chumbak-Made-India-Laptop-Sleeve/dp/B01LY4T4EA', | ||
'3/5' | ||
], | ||
[ | ||
'DailyObj Laptop Sleeve', | ||
'dailyobjects.com/dailyobjects-burgundy-vegan-leather-zippered-sleeve-for-14-laptop-macbook', | ||
'4.5/5' | ||
], | ||
[ | ||
'SouledStore Sleeve', | ||
'thesouledstore.com/product/pbl-premier-badminton-league-laptop-sleeve ', | ||
'2/5' | ||
] | ||
] | ||
|
||
app=Flask(__name__,static_folder='static') | ||
|
||
p = Predictor() | ||
|
||
@app.route('/getProds',methods=['POST','GET']) | ||
def save(): | ||
if request.method=='POST': | ||
return json.dumps(model.getPred(data)) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "Shogonai", | ||
"version": "1.0", | ||
"description": "Shogonai", | ||
"permissions": ["storage", "tabs", "webNavigation", "pageCapture"], | ||
"background": { | ||
"scripts": ["jq.js", "script.js"], | ||
"persistent": false | ||
}, | ||
"browser_action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"manifest_version": 2, | ||
"icons": { | ||
"128": "logo128.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style type="text/css"> | ||
*{ | ||
padding: 0px; | ||
margin: 0px; | ||
background-color: transparent; | ||
font-family: avenir next; | ||
} | ||
html{ | ||
height: 590px; | ||
width: 400px; | ||
} | ||
body{ | ||
background-color: #fff; | ||
} | ||
h1{ | ||
text-transform: uppercase; | ||
font-weight: 700; | ||
text-align: center; | ||
letter-spacing: 2px; | ||
font-size: 14pt; | ||
color: #444; | ||
padding-top: 40px; | ||
} | ||
.desc{ | ||
width: 80%; | ||
padding-top: 20px; | ||
font-size: 12pt; | ||
font-weight: 400; | ||
color: #555; | ||
margin: auto; | ||
} | ||
.rec{ | ||
position: relative; | ||
width: 95%; | ||
margin: auto; | ||
margin-top: 15px; | ||
border-radius: 9px; | ||
height: 100px; | ||
/*background-color: #fff;*/ | ||
} | ||
|
||
.rec-name, a, .rating{ | ||
width: auto; | ||
position: relative; | ||
left: 100px; | ||
} | ||
|
||
.rec-img{ | ||
position: absolute; | ||
height: 60px; | ||
width: 60px; | ||
top: 20px; | ||
left: 20px; | ||
border-radius: 3px; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.rec-name{ | ||
font-weight: 500; | ||
color: #333; | ||
font-size: 11pt; | ||
padding-top:15px; | ||
} | ||
|
||
a{ | ||
display: inline-block; | ||
text-decoration: none; | ||
color: #669cff; | ||
font-weight: 700; | ||
font-size:10pt; | ||
margin-top: 10px; | ||
text-transform: uppercase; | ||
height: 20px; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
width: 65%; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.rating{ | ||
display: inline-block; | ||
background-image: linear-gradient(to right, #ff759b, #f37255); | ||
color: rgba(0,0,0,0.5); | ||
padding-left: 4px; | ||
padding-right: 4px; | ||
padding-top: 3px; | ||
padding-bottom: 3px; | ||
border-radius: 8px; | ||
font-weight: 600; | ||
font-size: 10pt; | ||
margin-top: 5px; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<h1>Shogonai</h1> | ||
<div class="desc">You might be interested in there products too. Have a look!</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i3.jpg')"></div> | ||
<h3 class="rec-name">Bewakoof T-Shirt</h3> | ||
<a href="https://www.bewakoof.com/p/gym-karo-half-sleeve-t-shirt-for-men">https://www.bewakoof.com/p/gym-karo-half-sleeve-t-shirt-for-men</a> | ||
<br> | ||
<div class="rating">3/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i8.jpg')"></div> | ||
<h3 class="rec-name">SouledStore T-Shirt</h3> | ||
<a href="https://www.thesouledstore.com/product/namaste-bitches-tshirt">https://www.thesouledstore.com/product/namaste-bitches-tshirt</a> | ||
<br> | ||
<div class="rating">4/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i7.jpg')"></div> | ||
<h3 class="rec-name">PopXO T-Shirt</h3> | ||
<a href="https://www.popxo.com/product/adulting-t-shirt-boyfriend-fit">https://www.popxo.com/product/adulting-t-shirt-boyfriend-fit</a> | ||
<br> | ||
<div class="rating">2/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i10.jpg')"></div> | ||
<h3 class="rec-name">TMC Beard Oil</h3> | ||
<a href="https://www.themancompany.com/products/almond-thyme-beard-oil?variant=20823289991">https://www.themancompany.com/products/almond-thyme-beard-oil?variant=20823289991</a> | ||
<br> | ||
<div class="rating">2.5/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i1.jpg')"></div> | ||
<h3 class="rec-name">Beardo Oil</h3> | ||
<a href="https://www.beardo.in/oil/beardo-beard-hair-growth-oil-for-full-beard">https://www.beardo.in/oil/beardo-beard-hair-growth-oil-for-full-beard</a> | ||
<br> | ||
<div class="rating">3/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i4.jpg')"></div> | ||
<h3 class="rec-name">BMC Oil</h3> | ||
<a href="https://www.amazon.in/Bombay-Shaving-Company-Beard-Growth/dp/B07H83VQ4Z ">https://www.amazon.in/Bombay-Shaving-Company-Beard-Growth/dp/B07H83VQ4Z</a> | ||
<br> | ||
<div class="rating">4/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i2.jpg')"></div> | ||
<h3 class="rec-name">Beardhood Oil</h3> | ||
<a href="https://www.amazon.in/Beardhood-Subtle-Citrus-Beard-30ml/dp/B071VPVKG6">https://www.amazon.in/Beardhood-Subtle-Citrus-Beard-30ml/dp/B071VPVKG6</a> | ||
<br> | ||
<div class="rating">3.5/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i5.jpg')"></div> | ||
<h3 class="rec-name">Chumbak Laptop Sleeve</h3> | ||
<a href="https://www.amazon.in/Chumbak-Made-India-Laptop-Sleeve/dp/B01LY4T4EA">https://www.amazon.in/Chumbak-Made-India-Laptop-Sleeve/dp/B01LY4T4EA</a> | ||
<br> | ||
<div class="rating">3/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i6.jpg')"></div> | ||
<h3 class="rec-name">DailyObj Laptop Sleeve</h3> | ||
<a href=" https://www.dailyobjects.com/dailyobjects-burgundy-vegan-leather-zippered-sleeve-for-14-laptop-macbook">https://www.dailyobjects.com/dailyobjects-burgundy-vegan-leather-zippered-sleeve-for-14-laptop-macbook</a> | ||
<br> | ||
<div class="rating">4.5/5</div> | ||
</div> | ||
<div class="rec"> | ||
<div class="rec-img" style="background-image: url('i9.jpg')"></div> | ||
<h3 class="rec-name">SouledStore Sleeve</h3> | ||
<a href="https://www.thesouledstore.com/product/pbl-premier-badminton-league-laptop-sleeve ">https://www.thesouledstore.com/product/pbl-premier-badminton-league-laptop-sleeve</a> | ||
<br> | ||
<div class="rating">2/5</div> | ||
</div> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function toOpen(){ | ||
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { | ||
var activeTab = tabs[0]; | ||
var url = activeTab.url; | ||
dom = url.split('//')[1]; | ||
dom = dom.split('/')[0]; | ||
alert(dom); | ||
}); | ||
} | ||
|
||
|
||
behav = $.get('http:/localhost:5000/getProds'); | ||
|
||
html = ''; | ||
|
||
for(let i = 0; i < behav.length; i++){ | ||
html += '<div class="rec">' | ||
html += '<div class="rec-img" style="background-image: url('i1.jpg')"></div>' | ||
html += '<h3 class="rec-name">'+behav[i][0]+'</h3>' | ||
html += '<a href="'+behav[i][1]+'"></a>' | ||
html += '<br>' | ||
html += '<div class="rating">'+behav[i][2]+'</div>'; | ||
html += '</div>'; | ||
} | ||
|
||
window.innerHTML += html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*{ | ||
padding: 0px; | ||
margin: 0px; | ||
background-color: transparent; | ||
font-family: avenir next; | ||
} | ||
|
||
html{ | ||
height: 400px; | ||
width: 280px; | ||
} | ||
body{ | ||
background-color: #333; | ||
} |