Skip to content

Commit e63a7c1

Browse files
committed
Liking Ang Global Blogs Available
1 parent 797e1e6 commit e63a7c1

File tree

184 files changed

+77812
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+77812
-201
lines changed

CodingBlood.html

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<!DOCTYPE html>
2+
<!-- saved from url=(0023)http://localhost:3000/# -->
3+
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4+
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<!-- <link rel="stylesheet" href="template.css"> -->
8+
<link href="./CodingBlood_files/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
9+
<script src="./CodingBlood_files/bootstrap.bundle.min.js.download" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
10+
<title>CodingBlood</title>
11+
</head>
12+
13+
<body data-new-gr-c-s-check-loaded="14.1012.0" data-gr-ext-installed="">
14+
<nav class="navbar sticky-top navbar-dark bg-dark">
15+
<div class="container-fluid shadow-lg">
16+
<a class="navbar-brand" href="http://localhost:3000/#">
17+
<img src="./CodingBlood_files/wallpapersden.com_not-today-got_3840x2400.jpg" alt="" width="50" height="50" class="d-inline-block align-text-top rounded-circle">
18+
19+
</a>
20+
<a class="navbar-brand" href="http://localhost:3000/#">CodingBlood</a>
21+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
22+
<span class="navbar-toggler-icon"></span>
23+
</button>
24+
<div class="collapse navbar-collapse" id="navbarNav">
25+
<ul class="navbar-nav">
26+
<li class="nav-item">
27+
<a class="nav-link active" aria-current="page" href="http://localhost:3000/">Home</a>
28+
</li>
29+
<li class="nav-item">
30+
<a class="nav-link" href="http://localhost:3000/Login">Login</a>
31+
</li>
32+
<li class="nav-item">
33+
<a class="nav-link" href="http://localhost:3000/SignUp">SignUp</a>
34+
</li>
35+
<li class="nav-item">
36+
<a class="nav-link disabled" href="http://localhost:3000/#" tabindex="-1" aria-disabled="true">Disabled</a>
37+
</li>
38+
</ul>
39+
</div>
40+
</div>
41+
</nav>
42+
43+
<div id="carouselExampleControls" class="carousel slide pointer-event" data-bs-ride="carousel">
44+
<div class="carousel-inner" style="height: 50%;width: 100%;">
45+
<div class="carousel-item">
46+
<img src="./CodingBlood_files/pexels-pixabay-531880.jpg" class="d-block w-100" alt="...">
47+
<div class="carousel-caption d-none d-md-block">
48+
<h5>First slide label</h5>
49+
<p>Some representative placeholder content for the first slide.</p>
50+
</div>
51+
</div>
52+
<div class="carousel-item active">
53+
<img src="./CodingBlood_files/pexels-daniel-absi-952670.jpg" class="d-block w-100" alt="...">
54+
<div class="carousel-caption d-none d-md-block">
55+
<h5>First slide label</h5>
56+
<p>Some representative placeholder content for the first slide.</p>
57+
</div>
58+
</div>
59+
<div class="carousel-item">
60+
<img src="./CodingBlood_files/pexels-sebastiaan-stam-1097456.jpg" class="d-block w-100" alt="...">
61+
<div class="carousel-caption d-none d-md-block">
62+
<h5>First slide label</h5>
63+
<p>Some representative placeholder content for the first slide.</p>
64+
</div>
65+
</div>
66+
</div>
67+
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
68+
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
69+
<span class="visually-hidden">Previous</span>
70+
</button>
71+
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">
72+
<span class="carousel-control-next-icon" aria-hidden="true"></span>
73+
<span class="visually-hidden">Next</span>
74+
</button>
75+
</div>
76+
<div class="p-5 mb-4 bg-light rounded-3">
77+
<div class="container-fluid py-5">
78+
<img src="./CodingBlood_files/Snapchat-1283668516.jpg" class="rounded float-end" width="150" height="300" alt="">
79+
<h1 class="display-5 fw-bold">Kartik Agarwal</h1>
80+
<br>
81+
<p class="col-md-8 fs-4">Python Developer | Machine Learning | Deep Learning | Competitive Programmer | C++
82+
Programmer | SWAG KiiT | New at Web+Android</p>
83+
<br>
84+
<button class="btn btn-primary btn-lg" type="button" data-bs-toggle="modal" data-bs-target="#aboutmodal">About Me</button>
85+
86+
87+
<!-- Modal -->
88+
<div class="modal fade shadow" id="aboutmodal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
89+
<div class="modal-dialog modal-dialog-centered">
90+
<div class="modal-content">
91+
<div class="modal-header">
92+
<h5 class="modal-title" id="exampleModalLabel">About Me</h5>
93+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
94+
</div>
95+
<div class="modal-body shadow-lg">
96+
<p>Hi!</p>
97+
<p>My name is Kartik, currently earning my Bachelor of Technology degree from KIIT Deemed to be
98+
University.</p>
99+
<p>I am a Machine and Deep Learning Engineer and am gaining experience with each passing day.😀</p>
100+
<p>I am also a Python Developer . I recently developed a Tkinter GUI Desktop Application with
101+
multithreading and MongoDB support</p>
102+
<p>You can find me on GitHub By userid 'CodingBlood'</p>
103+
<p>I am also an Competitive Programmer. which I do through C++ (basically first language I
104+
learned as a hobby, which paid off today😜).You can find me on Codeforces by userID
105+
'parinda'</p>
106+
</div>
107+
<div class="modal-footer">
108+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
109+
</div>
110+
</div>
111+
</div>
112+
</div>
113+
</div>
114+
</div>
115+
<h1>HI</h1>
116+
<h1>HI</h1>
117+
<h1>HI</h1>
118+
<h1>HI</h1>
119+
<h1>HI</h1>
120+
<h1>HI</h1>
121+
<h1>HI</h1>
122+
<h1>HI</h1>
123+
<h1>HI</h1>
124+
<h1>HI</h1>
125+
<h1>HI</h1>
126+
127+
128+
</body></html>
132 KB
Loading

CodingBlood_files/bootstrap.bundle.min.js.download

+7
Large diffs are not rendered by default.

CodingBlood_files/bootstrap.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
408 KB
Loading
Loading
Loading

index.js

+51-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//impoting libraries and configuring them
22
const express = require("express");
3+
const BSON = require('bson');
34
const session = require('express-session')
45
const app = express();
56
let alert = require('alert');
@@ -86,7 +87,7 @@ app.post('/SignUp', async(req,res)=>{
8687
app.get('/SignUp',(req,res)=>{
8788
res.render('signup')
8889
})
89-
app.post('/SignOut',(req,res)=>{
90+
app.get('/SignOut',(req,res)=>{
9091
req.session.username=null;
9192
res.redirect('/');
9293
})
@@ -101,19 +102,60 @@ app.get('/Secret/:username',async(req,res)=>{
101102
const udetail = await collection.findOne(query);
102103
const post_collection = client.db("Portfolio").collection("BlogPost");
103104
const post_query = {
104-
visibility : 'v'
105+
username: req.params.username
105106
};
106-
const post_details = await post_collection.find({});
107+
const post_details = await post_collection.find(post_query).sort({"Stars": 1});
107108
const allValues = await post_details.toArray();
108-
console.log(allValues)
109-
// while (await post_details.hasNext()) {
110-
// await post_details.next();
111-
// }
112-
// const data= {}
113-
// await post_details.forEach(data = data + console.dir());
114109
res.render('ControlCenter',{fname:udetail.fname,lname:udetail.lname,uname:udetail.username,postdetail:allValues.reverse()});
115110
}
116111
})
112+
app.get('/Secret',async(req,res)=>{
113+
if(!req.session.username){
114+
res.redirect('/Login');
115+
}else{
116+
res.redirect('/Secret/' + req.session.username)
117+
}
118+
})
119+
120+
app.get('/TBlogs',async(req,res)=>{
121+
if(!req.session.username){
122+
res.redirect('/Login');
123+
}else{
124+
const post_collection = client.db("Portfolio").collection("BlogPost");
125+
const post_details = await post_collection.find({}).sort({"Stars": 1});
126+
const allValues = await post_details.toArray();
127+
res.render('TBlogs',{uname:req.session.username,postdetail:allValues.reverse()});
128+
}
129+
})
130+
app.post('/Star/:id/:username',async(req,res)=>{
131+
if(!req.session.username){
132+
res.redirect('/Login');
133+
}else{
134+
const post_collection = client.db("Portfolio").collection("BlogPost");
135+
post_collection.updateOne({_id:BSON.ObjectId(req.params.id)},{
136+
$inc: {
137+
Stars: +1
138+
}
139+
}, (err,result) => {
140+
if(err) console.log(err);
141+
console.log(result)
142+
});
143+
144+
post_collection.findOne({_id:BSON.ObjectId(req.params.id)}, (err, post) => {
145+
if(post){
146+
console.log("*VVHBK&*T^%", post)
147+
}
148+
if(err){
149+
console.log(err)
150+
}
151+
});
152+
// itemsCollection.updateOne(query, update, options)
153+
// const allValues = await post_details.toArray();
154+
// console.log(allValues)
155+
// res.redirect('/Secret/' + req.params.username)
156+
res.redirect('back')
157+
}
158+
})
117159

118160
app.post('/Post/:username', async(req,res)=>{
119161
const {desc , tittle} = req.body;

node_modules/base64-js/LICENSE

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/base64-js/README.md

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/base64-js/base64js.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/base64-js/index.d.ts

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)