Final Report Original Report
Final Report Original Report
A PROJECT REPORT
Submitted by
R.BENEDIT(962919104005)
M.PANEER SELVAM(962919104009)
M.S.SIVA SANKAR(962919104013)
N.S.SURJITH(962919104016)
of
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
MAY 2023
i
APPENDIX 1
degreeof
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
MAY 2023
ii
APPENDIX 2
BONAFIDE CERTIFICATE
Certified that this project report “SEARCH ENGINE CLONING”is the bonafide work
of“BENEDIT.R(962919104005), PANEER SELVAM.M(962919104009), M.S.SIVA
SANKAR(962919104013), N.S.SURJITH(962919104016)”who carried out the project
work under my supervision.
SIGNATURE SIGNATURE
Mrs.B.PRIYA, Mrs.J. JEROPHINE BENI,
This Project report was submitted for the viva-voice held at VINS Christian
College of Engineering on …………
iii
APPENDIX 3
TABLE OF CONTENTS
1. INTRODUCTION 1
1.1 Introduction 1
1.2 Idea Description 2
1.3 Overview of the Project 45
2. LITERATURE REVIEW 69
3. SYSTEM ANALYSIS
4. SYSTEM REQUIREMENTS 69
4.1 Software Requirements 75
5. SYSTEM DESIGN
5.1 Cloning 1
5.2 Search Engine Optimimization 2
6. SYSTEM IMPLEMENTATION
6.1 Modules 1
6.2 Search Engine Optimization 2
8. TESTING
8.1 Introduction 1
8.2 Testing 2
iv
9. CONCLUSION AND FUTURE ENHANCEMENT
9.1 Conclusion 1
9.2 Future Enhancement 2
APPENDIX
A.1 Domain Description
A.2 Language Description
A.3 Source Code
v
6 LIST OF FIGURES
Optimization 1
Acknowledgement 2
Request
vi
ACKNOWLEDGEMENT
We take this opportunity to put on record our sincere thanks to all who
enlightened our path towards the successful completion of this project. At the very
outlet, we thank the God almighty for his abundant blessing showered on us to follow
the path of success in easy attempt of our life.
We would like to express our deep sense of gratitude and respectful regards to
our beloved chairman Thiru. NANJIL M. VINCENT Ex.MP for giving an
opportunity to do this project.
We also express our sincere thanks to Dr.GAVASKAR VINCENT,
Secretary, Vins Christian College of Engineering, Chunkankadai, Nagercoil, for
giving chance to do this project.
We also express our sincere thanks to Dr.DYANA CHRISTILDA.V,
Principal, Vins Christian College of Engineering, Chunkankadai, Nagercoil, for giving
chance to do this project.
We thank our Head of the Department, Mrs.PRIYA.B., who gave constant
support and kind co-operation to us and provided required facilities to complete our
project without hurdles.
It is our greatest privilege to convey heartfelt thanks to Mrs.
JEROPHINE BENI.J, who helped us through this project as our project coordinator
for his kindness, valuable suggestions and encouragement in all stages for
accomplishment of our project work.
Last but not the least we thank our Staffs, Parents and everyone who directly
and indirectly helped us to bring this project successfully.
vii
ABSTRACT
viii
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
Cloning
In computing, a clone is hardware or software that is designed to function
in exactly the same way as another system.[1] A specific subset of clones are remakes (or
remades), which are revivals of old, obsolete, or discontinued products.
Motivation
Clones and remakes are created for reasons including competition,
standardization, availability across platforms, and as homage. Compatibility with the
original system is usually the explicit purpose of cloning hardware or low-level software
such as operating systems (e.g. AROS and MorphOS are intended to be compatible with
AmigaOS). Application software is cloned by providing the same functionality.
Hardware clones
When IBM announced the IBM PC in 1981, other companies such as Compaq
decided to offer clones of the PC as a legal reimplementation from the PC's documentation
or reverse engineering. Because most of the components, except the PC's BIOS, were
publicly available, all Compaq had to do was reverse-engineer the BIOS. The result was
a machine with similar performance and lower price than the machines cloned. The use
of the term "PC clone" to describe IBM PC compatible computers fell out of use in the
1990s; the class of machines it now describes are simply called PCs, but the early use of
the term "clone" usually implied a higher level of compatibility with the original IBM PC
than "PC-Compatible", with (often Taiwanese) clones of the original circuit (and possibly
ROMs) the most compatible (in terms of software they would run and hardware tests they
would pass)
0
Software clones
Software can be cloned by reverse engineering or legal reimplementation
from documentation or other sources, or by observing a program's appearance and
behavior. The reasons for software cloning may include circumventing undesirable
licensing fees, acquiring knowledge about the features of the system or creating an
interoperable alternative for an unsupported platform. GNU, a clone of UNIX, was
motivated by a need of the free software movement for an operating system composed of
entirely free software.
1
CHAPTER 2
LITERATURE REVIEW
2
2.2 Search Engine for the Internet of Things: Lessons From Web
Search, Vision, and Opportunities
Published in: IEEE Access ( Volume: 7) Authors : Fan Liang; Cheng Qian; William
Grant Hatcher; Wei Yu
3
2.3 Direct Answers in Google Search Results
Published in: IEEE Access ( Volume: 8) Authors : Artur Strzelecki; Paulina Rutecka
This study aims to explore Google's new “featured snippet” (a direct answer
that appears in web search results) to better understand the method of extracting and
displaying such answers above regular ranked results. The motivation for the study was
to investigate form, structure, and relation to query, content, and domain of the direct
answer. This study utilized a dataset of 743,798 keywords and the displayed direct
answers. It also included web search data for every direct answer, The main finding
concerns the form of construction of keywords used in the website content. Keywords
should be built in the form of short, two-to-four-word sentences comprising the subject
and its attribute. Using relative pronouns, articles, and prepositions, as well as using
questions as queries, can help to properly define a query and display the best direct
answer. The dataset is relatively small compared to the volume of searches made daily.
No other factors were extracted from the URL, and all data concerned the Google search
engine only. Implications for webmasters include: keywords used in website content
should be close to grammar forms used in queries; use keywords in URLs; write a
comprehensive introduction section on the webpage; and use tables and lists HTML
markup. The main objective of this study was to examine the structure of the user's queries
which caused in appearing of direct answers. It is comprehensive and based on real data
used by web search engine users. The data used to support the findings have been
deposited in the Zenodo repository (https://doi.org/10.5281/zenodo.3541092).
4
2.4 A Study of Optimizing Search Engine Results through User
Interaction
In this paper, we propose a method for optimizing search engine results based
on user interaction. This method generates different search results mainly through the
user's operation on different search topics. There are two main differences between our
method and the traditional personalized search method: personal privacy and storage
space. First, traditional personal search methods need to record search and click records
for individual users. However, these records have great personal privacy issues for users;
especially in recent years, there have been personal privacy leaks that occurred in many
large online companies (such as Facebook and Yahoo). Secondly, because different users
need to record their own search records, the size of the storage space is closely related to
the number of users and the amount of search records stored. However, the sum of
individual users' search and click records is a huge storage space in today's Internet
environment. To avoid these two issues for traditional personalized search methods, this
study proposes a storage-free approach based on individual users operating on different
search topics. In general, in addition to avoiding personal privacy and storage space
issues, our method can also achieve optimal linear time in generating personalized search
results.
5
2.5 A Universal Search Engine for Additive Manufacturing
Published in: IEEE Access ( Volume: 11) Authors : Lars Folkerts; Nicholas Kater;
Nektarios Georgios Tsoutsos
6
CHAPTER 3
SYSTEM ANALYSIS
3.1 EXISTING SYSTEM
MUSIFY-CLONE
Most modern clone which is a clone of Spotify.This is build with the help
of scripting language and its framework.All subsequent packets belonging to that flow,
and especially the system which is expressed and its frameworks are used in the cloning
system to complete the work.
FACEBOOK-CLONE
Facebook cloning is a scam in which the attacker copies the profile picture of
an authorized user, creates a new account using that person’s name and sends friend
requests to people on the user’s list. The exploit is often succesful because many
unsuspecting friends just accept the scammer’s requests, assuming that the actual user has
created a new account for some reason or forgetting that they are already friends with that
person.The scam doesn’t require any advanced technical knowledge or skills because the
user accounts aren’t actually hacked, just copied. Anyone on Facebook can see anyone
else’s profile picture and copy the image. Furthermore, because of the nature and purpose
of social networking, most people’s friends lists are public, which means that the attacker
can see, and send a request to, any or all of the user’s friends.
7
3.2 PROPOSED SYSTEM
8
CHAPTER 4
SOFTWARE REQUIREMENTS
To explain the concept of cloning we cloned a search engine with some added
extensions to bring difference between the original source for this process we used
scripting language and its framework to complete the work and the frameworks are React
js and plugin VITE with these we explained the idea of cloning practically and deployed
it in a database called firebase and we use VScode to implent the language.
9
CHAPTER 5
SYSTEM DESIGN
5.1 CLONING
10
5.2 SEARCH ENGINE OPTIMIZATION
11
Search crawlers constantly scan the web, gathering, categorizing, and storing the billions
of web pages out there in its index. When you search for something and Google pulls up
results, it’s pulling from its index, not the web itself. Google uses a complex formula
(called an algorithm) to order results based on a number of criteria (ranking factors—
which we’ll get into next) including the quality of the content, its relevance to the search
query, the website (domain) it belongs to, and more. How people interact with results then
further indicates to Google the needs that each page is (or isn’t) satisfying, which also
gets factored into the algorithm.According to optimization
1. Consistent publication of high-quality content (26%)
2. Keywords in meta title (17%)
3. Backlinks (15%)
4. Niche expertise (13%)
5. User engagement (11%)
6. Internal links (5%)
12
7. Mobile-friendly/mobile-first (5%)
8. Page speed (2%)
9. Site security/SSL certificate (2%)
10. Schema markup/structured data (1%)
11. Keywords in URL (1%)
12. Keywords in H1 (1%)
But make no mistake about the factors at the bottom of this list. As you can see in
the below chart, “Other” factors, like unlinked mentions, social signals, domain
history, outbound links, and site structure, carry 1% weight. But given that there
are at least 200 Google ranking factors; that’s at least 189 “other” factors that
collectively make up that 1%. In other words, those seemingly small factors, like
keywords in URL, that on their own make up 1%, are not so small
13
CHAPTER 6
SYSTEM IMPLEMENTATION
6.1 MODULES
➢ Binaries
➢ Material-ui/icons
➢ Netlify
➢ Scripts
➢ Frameworks React and Plugin VITE
➢ Request
➢ Acknowledgement
6.1.1.1) Binaries
A binary code represents text, computer processor instructions, or any other data
using a two-symbol system. The two-symbol system used is often "0" and "1" from the
binary number system.
6.1.1.2) Material-ui/icons
Material UI is an open-source React component library that implements
Google's Material Design. It includes a comprehensive collection of prebuilt components
that are ready for use in production right out of the box.
14
6.1.1.3) Netlify
Netlify is a remote-first cloud computing company that offers a development
platform that includes build, deploy, and serverless backend services for web applications
and dynamic websites. The platform is built on open web standards, making it possible to
integrate build tools, web frameworks, APIs, and various web technologies into a unified
developer workflow
6.1.1.4) Scripts
A scripting language or script language is a programming language that is used
to manipulate, customize, and automate the facilities of an existing system.
15
6.1.2.2) Acknowledgement
This module is used to view the acknowledgement whether the packet is allowed
or denied. if it is allowed, iT show the matched rule else it will display unmatched reply.
6.2 FLOW CHART : OPTIMIZATION
16
ACKNOWLEDGEMENT
Rule id
STATUS
Client request
17
6.2.2 REQUEST
REQUEST
DATA SOURCE
SOURCE PORT
NAME NUMBER
SOURCE DESTINAT
IP ION PORT
ADDRES NUMBER
REQUEST
INFO&REQUEST
DESTINA
PACKET
TION IP ID
ADDRES
S
PROTOC
OL
DATA
CL-REQUEST
18
CHAPTER 7
IMPLEMENTATION & WORKING
Step1: File >>Open Folder >> NewFolder >> Selectfolder to open the new
folder.
19
(ii) To start the React app
20
(iii) The Local Host Will Popup In The Screen
21
(i) To bring difference from the original source we added a extension
chatbot in the cloned program
22
Result & Output
23
24
CHAPTER 8
TESTING
8.1 INTRODUCTION
25
CHAPTER 9
CONCLUSION AND FUTURE ENHANCEMENT
9.1 CONCLUSION
Cloning is in great demand today apart from its various shortcomings. It has
proven to be an advantageous process in fast development of the software systems to meet
the deadlines or to complete the work on time, etc. It is considered as a great boon to
industries. Also, various tools and techniques have been proposed to detect the clones,
wherever required, to overcome the various pitfalls released by cloning like bug
propagation, maintenance costs, etc. Further detection process comprises of different
levels such as preprocessing, transformation, match detection and so on. These techniques
and tools can detect various types of clones according to their efficiency and ability.
Furthermore, research in this field is still in continuation for introduction of new highly
efficient and applicable tools or techniques that will meet up with the requirement of
detecting all types of clones because as discussed earlier, there are still many techniques
and tools which are not able to detect all types of clones.
26
APPENDIX
A.1 DOMAIN DESCRIPTION
There are certain benefits associated with cloning. Cloning can help a new
program or application be more compatible with existing applications or environments. If
there is no violation of copyright of original source code or software, cloning can help in
improving the software. The process of actually making another exact replica of the object
instead of just its reference is called cloning. In most languages, the language or libraries
can facilitate some sort of cloning. In Java, the Object class contains the clone() method,
which copies the object and returns a reference to that copied object. Since it is in the
Object class, all classes defined in Java will have a clone method available to the
programmer (although to function correctly it needs to be overridden at each level it is
used).
27
A C++ example of object cloning:
Object originalObj;
Object copyObj(originalObj); // creates a copy of originalObj named copyObj
A C++ example of object cloning using pointers (to avoid slicing see[1]):
28
A.2 LANGUAGE DESCRIPTION
Features of JavaScript
There are following features of JavaScript:
All popular web browsers support JavaScript as they provide built-in execution
environments.
➢ JavaScript follows the syntax and structure of the C programming language. Thus, it
is a structured programming language.
➢ JavaScript is a weakly typed language, where certain types are implicitly cast
(depending on the operation).
➢ JavaScript is an object-oriented programming language that uses prototypes rather
than using classes for inheritance.
➢ It is a light-weighted and interpreted language.
29
➢ It is a case-sensitive language.
➢ JavaScript is supportable in several operating systems including, Windows, macOS,
etc.
Framework of JavaScript
A JavaScript framework is a collection of JavaScript code libraries that
provide a web developer with pre-written code for routine programming tasks.
Frameworks are structures with a particular context and help you create web applications
within that context. Popular frameworks such as React, Angular.JS, and Vue.js are gaining
and losing a legion of followers but still manage to rank top in best JavaScript frameworks
30
REACT AND PLUG-IN
React
React, also known as React.js, is one of the best JavaScript frameworks in the
front-end category. It is an open-source front-end JavaScript library created by a team of
Facebook developers led by Jordan Walke back in 2011 and became open-source in June
2013. The initial prototype was dubbed “FaxJS” and was first experimented with in
Facebook’s Newsfeed. React can be considered one of the biggest influential disruptors
in the web development domain that delivered a real breakthrough in shaping the web
applications we see today. React introduced a component-based, functional, and
declarative programming style for creating interactive user interfaces for mainly single-
page web applications. React delivers blazing-fast rendering by making use of ‘Virtual
DOM.’ DOM stands for Document Object Model, which renders only those components
that have changed instead of rendering the whole page. Another key feature of React is
simpler JSX syntax instead of JavaScript.
PLUG-IN
Vite is a framework for automating rich client applications based on Win32,
WinForms, WPF, Silverlight and SWT (Java) platforms. It is .NET based and does not
require the use of any proprietary scripting languages. Tests/automation programs using
White can be written with whatever .NET language, IDE and tools you are already using.
White provides a consistent object-oriented API, hiding the complexity of Microsoft's UI
Automation library (on which White is based) and windows messages.
Architecture
Index1
Silverlight Support
31
You would need to add reference to white.webbrowser.dll along with
TestStack.White.dll.
InternetExplorerWindowbrowserWindow=
InternetExplorer.Launch("http://localhost/white.testsilverlight/TestSilverlightApplicatio
nTestPage.aspx", "FooApp Title - Windows Internet Explorer");
SilverlightDocumentdocument= browserWindow.SilverlightDocument;
Button button = document.Get<Button>("buton");
Label label = document.Get<Label>("status");
Silverlight support is not tested, and likely has many issues. I am considering dropping
Silverlight support unless members of the Community improve test coverage of the
Silverlight support in vite
32
A.3 SOURCE CODE
➢ Code for Home Page:
App.js
import React from "react";
import './App.css';
import Home from "./Home";
import SearchPage from "./SearchPage";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
function App() {
return (
<div className="app">
<Router>
<Switch>
<Route path="/search">
<SearchPage />
</Route>
<Route path='/'>
<Home />
</Route>
</Switch>
</Router>
</div>
);
}
33
Home.js
import React from 'react';
import './Home.css';
import { Link } from "react-router-dom";
import AppsIcon from "@material-ui/icons/Apps";
import { Avatar } from "@material-ui/core"
import Search from './Search';
import '@chatscope/chat-ui-kit-styles/dist/default/styles.min.css';
import { MainContainer, ChatContainer, MessageList, Message, MessageInput, TypingIndicator }
from "@chatscope/chat-ui-kit-react";
// import { Hidden } from '@material-ui/core';
import { useState } from 'react'
const API_KEY = "your Api key";
function Home() {
const [typing, setTyping] = useState(false)
let isHome = true
const [messages, setMessages] = useState([
{
message: "Hello!,im chat bot",
sender: "ChatGPT!"
}
])
const [chatbotActive, setChatbotActive] = useState(false);
const handleSend = async (message) => {
const newMessage = {
message: message,
sender: "user",
direction: "outgoing"
}
34
setMessages(newMessages);
setTyping(true);
await processMessageTochatGPT(newMessages);
}
async function processMessageTochatGPT(chatMessages) {
let apiMessages = chatMessages.map((messageObject) => {
let role = "";
if (messageObject.sender === "ChatGPT") {
role = "assistant";
} else {
role = "user";
}
return { role: role, content: messageObject.message }
});
const systemMessage = {
role: "system",
content: "Explain all concepts like professional engineer"
}
const apiRequestBody = {
"model": "gpt-3.5-turbo",
"messages": [
systemMessage, // The system message DEFINES the logic of our chatGPT
35
"Content-Type": "application/json"
},
body: JSON.stringify(apiRequestBody)
}).then((data) => {
return data.json();
}).then((data) => {
console.log(data);
setMessages([...chatMessages, {
message: data.choices[0].message.content,
sender: "ChatGPT"
}]);
setTyping(false);
});
}
return (
<div className='home'>
<div className='home__header'>
<div className='home__headerLeft'>
<Link to='/about'>About</Link>
<Link to='/store'>Store</Link>
</div>
<form className='home__headerRight'>
<Link to='/google' onClick={() => window.open('http://www.gmail.com')}
>Gmail</Link>
<Link to='/images' onClick={() =>
window.open('https://www.google.co.in/imghp?hl=en&tab=ri&ogbl ')}>Images</Link>
<AppsIcon />
<Avatar />
</form>
36
</div>
<div className='home__body'>
<img
src={require('./bb.jpeg')}
alt='google'
/>
<div className='home__inputContainer' >
<Search isHome />
</div>
</div>
<div className='App ' id='appss'
style={{ position: "relative", height: "500px", width: "400px" }}>
<button className='chtbt' onClick={handleToggleChatbot}>Chatbot</button> {/* the
toggle button */}
{chatbotActive && (
<MainContainer>
<ChatContainer>
<MessageList
scrollBehavior='smooth'
typingIndicator={typing ? <TypingIndicator content="chatbot is typing!!!!!!" /> :
null}
>
{messages.map((message, i) => {
return <Message key={i} model={message} />
})}
</MessageList>
<MessageInput placeholder='Type message here' onSend={handleSend} />
</ChatContainer>
</MainContainer>)}
</div>
</div>
)
}export default Home
37
Home.css
.home {
display: flex;
flex-direction: column;
height: 100vh;
}
.home__header {
display: flex;
justify-content: space-between;
padding: 20px 30px;
align-items: center;
}
.home__header a {
margin-right: 20px;
text-decoration: inherit;
color: rgba(0, 0, 0, 0.87);
font-size: 15px;
}
.home__header a:hover {
text-decoration: underline;
}
.home__headerRight {
display: flex;
align-items: center;
min-width: 13vw;
justify-content: space-between;
.home__headerRight>.MuiSvgIcon-root {
38
margin-right: 20px;
}
.home__body {
flex: 1;
display: flex;
margin-top: 6%;
flex-direction: column;
.home__body>img {
object-fit: contain;
height: 150px;
/* width: 600px; */
/* background-color: rgb(35, 227, 14); */
}
.App {
display: flex;
flex-direction: column;
margin-top: -350px;
margin-left: 824px;
border-radius: 30px;
animation: floatup .5s forwards;
/* overflow: hidden; */
}
.chtbt {
display: flex;
margin-left: 30px;
width: 70px;
height: 50px;
text-align: center;
39
padding: 10px;
padding-top: 17px;
margin-top: -50px;
margin-left: 370px;
border-radius: 100px;
border: none;
color: rgb(56, 36, 11);
background-color: rgb(57, 16, 238);
cursor: pointer;
box-shadow: 0 0px 1px 1px grey;
color: aliceblue;
}
.chtbt:hover {
color: rgb(30, 34, 34);
background-color: aqua;
border: none;
box-shadow: 0 0px 3px 1px rgb(21, 194, 220);
}
@keyframes floatup {
from {
transform: translateY(14px);
opacity: .0;
}
to {
transform: translateY(0px);
opacity: 1;
}
}
/* mobile view */
@media only screen and (max-width:600px) {
40
.App {
display: flex;
flex-direction: column;
margin-top: -300px;
margin-left: -20px;
border-radius: 30px;
animation: floatup .5s forwards;
/* overflow: hidden; */
}
.chtbt {
display: flex;
margin-left: 30px;
width: 60px;
height: 40px;
text-align: center;
padding: 7px;
padding-top: 13px;
margin-top: -50px;
margin-left: 370px;
border-radius: 100px;
#appss {
position: relative;
height: 200px;
width: 00px;
}
}
41
➢ Code For Searching
Search.js
import React, { useState, useEffect } from 'react';
import "./Search.css";
import SearchIcon from "@material-ui/icons/Search"
import MicIcon from "@material-ui/icons/Mic";
import { Button } from '@material-ui/core';
import { useHistory } from "react-router-dom"
import { useStateValue } from './StateProvider';
import { actionTypes } from './reducer';
if (!isHome) {
setInput(localStorage.getItem('myKey'))
}
}, [isHome])
const [{ }, dispatch] = useStateValue();
localStorage.setItem('myKey', input);
dispatch({
type: actionTypes.SET_SEARCH_TERM,
term: input
42
})
history.push("/search");
};
return (
<form className='search'>
<div className='search__input'>
<SearchIcon className="search__inputIcon" />
<input value={input} onChange={e => setInput(e.target.value)} />
<MicIcon />
</div>
{!hideButtons ? (
<div className='search__buttons'>
<Button
type='submit' onClick={search} variant='outlined'> Search</Button>
<Button variant='outlined'>I'm Feeling Lucky</Button>
</div>
):(
<div className='search__buttons'>
<Button className='search__buttonsHidden' type='submit' onClick={search}
variant='outlined'> Search</Button>
<Button className='search__buttonsHidden' variant='outlined'>I'm Feeling
Lucky</Button>
</div>
)
}
</form >
)
};
43
Search.css
.search__input {
display: flex;
align-items: center;
border: 1px solid lightgray;
height: 30px;
padding: 10px 20px;
border-radius: 999px;
width: 75vw;
margin: 0 auto;
margin-top: 40px;
max-width: 560px;
}
.search__input>input {
flex: 1;
padding: 10px 20px;
font-size: medium;
border: none;
}
.search__input>input:focus {
outline-width: 0;
}
.search__inputIcon {
color: gray;
}
.search__buttons {
margin-top: 30px;
display: flex;
justify-content: center;
}
44
.search__buttons button {
margin: 5px;
padding: 7px 15px;
background-color: #f8f8f8;
border: 1px solid white;
text-transform: inherit;
color: #5f6368;
}
.search__buttons button:hover {
box-shadow: 0 1px 1px rgba(0, 0, 0, 1);
background-image: -webkit-linear-gradient(top, #f8f8f8, #f1f1f1);
background-color: #f8f8f8;
border: 1px solid #c6c6c6;
color: #222;
.search__buttonsHidden {
display: none !important
}
45
useGoogleSearch.js
import { useState, useEffect } from 'react'
useEffect(() => {
fetch(`https://www.googleapis.com/customsearch/v1?key=${process.env.REACT_APP_API_KEY}&
cx=${CONTEXT_KEY}&q=${term}`
)
.then(response => response.json())
.then(result => {
setData(result)
})
}
fetchData();
}, [term])
return { data }
};
46
SearchPage.js
import React from 'react'
import './SearchPage.css'
import { useStateValue } from './StateProvider';
import useGoogleSearch from './useGoogleSearch';
import { Link } from 'react-router-dom';
import Search from './Search';
import SearchIcon from '@material-ui/icons/Search';
import DescriptionIcon from '@material-ui/icons/Description';
import ImageIcon from '@material-ui/icons/Image';
import LocalOfferIcon from '@material-ui/icons/LocalOffer';
import RoomIcon from '@material-ui/icons/Room';
import MoreVertIcon from '@material-ui/icons/MoreVert';
function SearchPage() {
const [{ term },] = useStateValue();
const { data } = useGoogleSearch(term);
return (
<div className='searchPage'>
<div className='searchPage__header'>
<Link to="/">
<img
className='searchPage__logo'
src={require('./bb.jpeg')}
alt='google' />
</Link>
<div className='searchPage__headerBody'>
<Search hideButtons term={term} />
<div className='searchPage__options'>
<div className='searchPage__optionsLeft'>
<div className="searchPage_option">
<SearchIcon />
<Link to="/all">All</Link>
</div>
47
<div className="searchPage_option">
<DescriptionIcon />
<Link to="/news">News</Link>
</div>
<div className="searchPage_option">
<ImageIcon />
<Link to="/images">Images</Link>
</div>
<div className="searchPage_option">
<LocalOfferIcon />
<Link to="/shopping">Shopping</Link>
</div>
<div className="searchPage_option">
<RoomIcon />
<Link to="/maps">Maps</Link>
</div>
<div className="searchPage_option">
<MoreVertIcon />
<Link to="/more">More</Link>
</div>
<div className="searchPage_optionsRight">
<div className="searchPage_option">
<Link to="/settings">Settings</Link>
</div>
<div className="searchPage_option">
<Link to="/tools">Tools</Link>
</div>
</div>
</div>
</div>
</div>
</div>
<div className='searchPage__results'>
48
{data && (
<div className='searchPage__results'>
<p className='searchPage__resultsCount'>
About{data?.searchInformation.formattedTotalResults}
results({data?.searchInformation.formattedSearchTime}seconds) for {term}
</p>
{data?.items.map(item => (
<div className='searchPage__result' key={item.link} >
<a href={item.link} target="_blank">
{item.pagemap?.cse_image?.length > 0 && item.pagemap?.cse_image[0]?.src
&& (
<img
className="searchPage_resultImage"
src={item.pagemap?.cse_image?.length > 0 &&
item.pagemap?.cse_image[0]?.src}
alt=''
/>
)}
{item.displayLink}
</a>
<a href={item.link}>
<h2>{item.displayLink}</h2>
</a>
<a className='searchPage__resultTitle' href={item.link}><h2>{item.title}</h2>
</a>
<p className='searchPage__resultSnippet'>{item.snippet} </p>
</div>
))}
</div>
)}
</div>
</div>
)
}export default SearchPage
49
SearchPage.css
@import url('https://fonts.googleapis.com/css?family=Quicksand&display=swap');
.searchPage__header {
display: flex;
position: sticky;
top: 0;
background-color: white;
z-index: 100;
align-items: flex-start;
padding: 30px;
border-bottom: 1px solid lightgray;
.searchPage__logo {
background-color: rgb(254, 254, 254);
object-fit: contain;
height: 50px;
margin-right: 50px;
}
.searchPage__headerBody>.search>.search__input {
margin-top: 0;
width: unset;
margin: unset;
max-width: unset;
}
.searchPage_option {
display: flex;
align-items: center;
50
color: gray;
}
.searchPage_option a,
.searchPage_optionsRight a {
text-decoration: none;
color: gray;
}
.searchPage_optionsRight,
.searchPage__optionsLeft {
display: flex;
}
.searchPage_optionsRight {
margin-left: 80px;
}
.searchPage_option {
display: flex;
align-items: center;
margin-right: 20px;
}
.searchPage_optiona {
margin-left: 5px;
}
.searchPage__result {
margin: 40px 0;
}
.searchPage__resultsCount {
51
font-size: 14px;
color: #70757a;
}
.searchPage__results {
max-width: 700px;
margin-top: 20px;
margin-left: 118px;
margin-bottom: 100px;
font-family: 'Muli', sans-serif;
}
.searchPage__resultTitle {
text-decoration: none;
}
.searchPage__resultTitle:hover {
text-decoration: underline;
}
.searchPage_resultTitle>h2 {
font-weight: 500;
}
.searchPage_resultSnippet {
margin-top: 10px;
}
.searchPage_resultImage {
object-fit: contain;
height: 20px;
width: 20px;
margin-right: 10px;
border-radius: 100%;}
52
StateProvider.js
import React, { createContext, useContext, useReducer } from "react";
index.js
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reducer, { initialState } from './reducer';
import { StateProvider } from './StateProvider';
53
index.css
*{
margin-top: 0;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
54
References
1. G.Sudeepthi, G. Anuradha and M. S. Babu, "A survey on semantic Web search
engine", Int. J. Comput. Sci. Issues, vol. 9, pp. 241-245, Mar. 2012.
2. R.Sachdeva and S. Gupta, "A literature survey on page rank algorithm", Int. J.
Sci. Eng. Res., vol. 9, no. 5, pp. 10-19, May 2018.
3. H. Dong, F. K. Hussain and E. Chang, "A survey in semantic search
technologies", Proc. 2nd IEEE Int. Conf. Digit. Ecosyst. Technol., pp. 403-408,
Feb. 2008.
4. J. A. Stankovic, "Research directions for the Internet of Things", IEEE Internet
Things J., vol. 1, pp. 3-9, Feb. 2014.
5. J. Lin, W. Yu, N. Zhang, X. Yang, H. Zhang and W. Zhao, "A survey on Internet
of things: Architecture enabling technologies security and privacy and
applications", IEEE Internet Things J., vol. 4, no. 5, pp. 1125-1142, Oct. 2017.
6. A. Zanella, N. Bui, A. Castellani, L. Vangelista and M. Zorzi, "Internet
of Things for smart cities", IEEE Internet Things J., vol. 1, no. 1, pp.
22-32, Feb. 2014.
7. W.-F. Chen, M. Hagen, B. Stein and M. Potthast, "A user study on
snippet generation: Text reuse vs. paraphrases", Proc. 41st Int. ACM
SIGIR Conf. Res. Develop. Inf. Retr., pp. 1033-1036, Jun. 2018.
8. D. Maxwell, L. Azzopardi and Y. Moshfeghi, "A study of snippet
length and informativeness", Proc. 40th Int. ACM SIGIR Conf. Res.
Develop. Inf. Retr., pp. 135-144, Aug. 2017.
9. The Digital Universe of Opportunities: Rich Data and the Increasing
Value of the Internet of Things, Jan. 2014
10.F. Wiesman, H. J. van den Herik and A. Hasman, "Information
retrieval by metabrowsing", J. Amer. Soc. Inf. Sci. Technol., vol. 55,
no. 7, pp. 565-578, May 2004.
55
11.C. Palihawadana and G. Poravi, "A comparative study of link analysis
algorithms", Proc. 8th Int. Conf. Intell. Syst. Model. Simul. (ISMS),
pp. 100-104, May 2018.
12.G. A. Longhitano, G. B. Nunes, G. Candido and J. V. L. da Silva, "The
role of 3D printing during COVID-19 pandemic: A review", Prog.
Additive Manuf., vol. 6, no. 1, pp. 19-37, Feb. 2021.
13. Y. Shi, Y. Zhang, S. Baek, W. D. Backer and R. Harik,
"Manufacturability analysis for additive manufacturing using a novel
feature recognition technique", Comput.-Aided Des. Appl., vol. 15, no.
6, pp. 941-952, Nov. 2018
14. C. Greer, A. Nycz, M. Noakes, B. Richardson, B. Post, T. Kurfess, et
al., "Introduction to the design rules for metal big area additive
manufacturing", Additive Manuf., vol. 27, pp. 159-166, May 2019.
15.F. Mezzadri, V. Bouriakov and X. Qian, "Topology optimization of
self-supporting support structures for additive manufacturing",
Additive Manuf., vol. 21, pp. 666-682, May 2018.
16. A. T. Gaynor and T. E. Johnson, "Eliminating occluded voids in
additive manufacturing design via a projection-based topology
optimization schem
56