Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flask running #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'MONGO_CLUSTER' = ''
'MONGO_USER' = ''
'MONGO_PASSWORD' = ''
'MONGO_CLUSTER' = 'cluster0.f4qlngr'
'MONGO_USER' = 'sathiyamsharmila'
'MONGO_PASSWORD' = 'cPa4sgHvfwQAhq7U'

'SENDER_EMAIL_ID' = ''
'SENDER_EMAIL_PASSWORD' = ''
'SENDER_EMAIL_ID' = 'kakashisharingan106@gmail.com'
'SENDER_EMAIL_PASSWORD' = 'itachiuchiha'

'TG_API_ID'= ''
'TG_API_HASH' = ''
'TG_API_ID'= '24053652'
'TG_API_HASH' = '40cf2fae5afefdde1cc2e134b17484da'
Binary file added __pycache__/helper.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def connectMongo() -> object:
client = MongoClient(connectionstring)

# connecting with database
db = client["BudgetBossDB"]
db = client["BUDGETBOSS"]

return db

Expand Down
197 changes: 111 additions & 86 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,98 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="/static/css/styles.css">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Budget Boss</title>
<link rel="shortcut icon" type="image/jpg" href="static/images/bbLogo.png"/>
</head>
<body>

<header>
<a class="navbar-brand logo" href="/">
<img src="static/images/bbLogo.png" alt="BB Logo" style="width:50px;" class="p-1 rounded-pill"> &nbsp;&nbsp;<b class="text-white">Budget Boss</b>
</a>
<div class="hamburger">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="/static/css/styles.css" />
<link
rel="stylesheet"
type="text/css"
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<title>Price tracker</title>
<link
rel="shortcut icon"
type="image/jpg"
href="static/images/bbLogo.png"
/>
</head>
<body>
<header>
<a class="navbar-brand logo" href="/">
<img
src="static/images/bbLogo.png"
alt="BB Logo"
style="width: 50px"
class="p-1 rounded-pill"
/>
&nbsp;&nbsp;<b class="text-white">Price tracker</b>
</a>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<nav class="nav-bar">
</div>
<nav class="nav-bar">
<ul>
<li class="nav-item">
{% if request.path == '/index' or request.path == '/' %}
<li class="nav-item ">
<a class="nav-link active " href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link " aria-current="page" href="tracker"><b>Tracker</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link " href="about"><b>About</b></a>
</li>

{% endif %}
{% if request.path == '/tracker' %}
<li class="nav-item">
<a class="nav-link " href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="tracker"><b>Tracker</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link " href="about"><b>About</b></a>
</li>

{% endif %}
{% if request.path == '/deals' %}
<li class="nav-item">
<a class="nav-link " href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="tracker"><b>Tracker</b></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about"><b>About</b></a>
</li>

{% endif %}
{% if request.path == '/about' %}
<li class="nav-item">
<a class="nav-link " href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="tracker"><b>Tracker</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="about"><b>About</b></a>
</li>

{% endif %}
</li>

<li class="nav-item">
<a class="nav-link active" href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="tracker"
><b>Tracker</b></a
>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about"><b>About</b></a>
</li>

{% endif %} {% if request.path == '/tracker' %}
<li class="nav-item">
<a class="nav-link" href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="tracker"
><b>Tracker</b></a
>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about"><b>About</b></a>
</li>

{% endif %} {% if request.path == '/deals' %}
<li class="nav-item">
<a class="nav-link" href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="tracker"
><b>Tracker</b></a
>
</li>
<li class="nav-item">
<a class="nav-link active" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="about"><b>About</b></a>
</li>

{% endif %} {% if request.path == '/about' %}
<li class="nav-item">
<a class="nav-link" href="index"><b>Home</b></a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="tracker"
><b>Tracker</b></a
>
</li>
<li class="nav-item">
<a class="nav-link" href="deals"><b>Deals</b></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="about"><b>About</b></a>
</li>

{% endif %}
</ul>
</nav>
</header>
<script>
hamburger = document.querySelector('.hamburger');
hamburger.onclick = function(){
navBar=document.querySelector('.nav-bar');
navBar.classList.toggle('active');
}
</script>
</nav>
</header>
<script>
hamburger = document.querySelector(".hamburger");
hamburger.onclick = function () {
navBar = document.querySelector(".nav-bar");
navBar.classList.toggle("active");
};
</script>

{% block body %}{% endblock %}
</body>
</body>
</html>
102 changes: 71 additions & 31 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,81 @@
{% extends "base.html" %}
{%block body%}
<div class="container mt-4 mb-3 pb-1">
<div class="row">
<div class="col-12 col-md">
<div class="h-100 w-md-11/12 w-xl-10/12 max-width-xnarrow">
<div class="h-100 d-flex flex-column justify-content-between">
<div>
<font color=#7ABFC4><h1 class="balance-text font-sans-serif mb-0.75">Budget Boss:<br data-owner="balance-text">How it Works ?</h1></font>
<br/>
<div class="post-excerpt">
<font color=#b8e0e3><p>
This price tracker bot provides a web interface to the user to enter the product link of supported e-commerce platforms and your email. It saves the provided link and email as well as the current price of the product in a database.
<br/>
<br/>
A scheduled script runs every hour to check the current price of the product and compare it with the saved price. If the current price is less than the saved price, the bot sends a mail to the user.
{% extends "base.html" %} {%block body%}
<div class="container mt-4 mb-3 pb-1">
<div class="row">
<div class="col-12 col-md">
<div class="h-100 w-md-11/12 w-xl-10/12 max-width-xnarrow">
<div class="h-100 d-flex flex-column justify-content-between">
<div>
<font color="#7ABFC4"
><h1 class="balance-text font-sans-serif mb-0.75">
Price Tracker:<br data-owner="balance-text" />How it Works ?
</h1></font
>
<br />
<div class="post-excerpt">
<font color="#b8e0e3"
><p>
This price tracker bot provides a web interface to the user to
enter the product link of supported e-commerce platforms and
your email. It saves the provided link and email as well as
the current price of the product in a database.
<br />
<br />
A scheduled script runs every hour to check the current price
of the product and compare it with the saved price. If the
current price is less than the saved price, the bot sends a
mail to the user.
</p>
<br />
<p>
Supported Websites:
<img
src="static/images/amazon.png"
alt="Amazon"
width="40px"
height="40px"
/>&nbsp;<img
src="static/images/flipkart.png"
alt="Flipkart"
width="35px"
height="35px"
/>&nbsp;<img
src="static/images/myntra.png"
alt="Myntra"
width="50px"
height="35px"
/>&nbsp;<img
src="static/images/boat.png"
alt="Boat"
width="40px"
height="40px"
/>
</p>
<br>
<p> Supported Websites: <img src="static/images/amazon.png" alt="Amazon" width="40px" height="40px">&nbsp;<img src="static/images/flipkart.png" alt="Flipkart" width="35px" height="35px">&nbsp;<img src="static/images/myntra.png" alt="Myntra" width="50px" height="35px">&nbsp;<img src="static/images/boat.png" alt="Boat" width="40px" height="40px"></p>
</font>
<br/>
<div class="btns"><a href="tracker" class="btn-primary" target="_blank" rel="noopener">Try&nbsp;now</a></div></div>
<br />
<div class="btns">
<a
href="tracker"
class="btn-primary"
target="_blank"
rel="noopener"
>Try&nbsp;now</a
>
</div>
</div>

</div>
</div>
</div>
<div class="
col-12 col-md-6 mt-0.75 mt-md-0
position-relative
">
<div class="mb-1 sticky js-sticky mt-ngutter pt-gutter">

<img class="w-100" src="static/images/mailSS.jpeg" alt="Sample Screenshot of mail">
</div>
</div>
<div class="col-12 col-md-6 mt-0.75 mt-md-0 position-relative">
<div class="mb-1 sticky js-sticky mt-ngutter pt-gutter">
<img
class="w-100"
src="static/images/mailSS.jpeg"
alt="Sample Screenshot of mail"
/>
</div>
</div>
</div>

{%endblock%}
</div>

{%endblock%}