Commit 555bea50 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent c8d82d40
This diff is collapsed.
...@@ -22,8 +22,6 @@ function Bookmark() { ...@@ -22,8 +22,6 @@ function Bookmark() {
// return true; // return true;
// } // }
// } // }
// const [index, setIndex] = useState(1);
// const [showSet, setShowSet] = useState([false, false, false, false]);
const add_Page = [{ const add_Page = [{
title:'즐겨찾기1', title:'즐겨찾기1',
url:'http://localhost:3000', url:'http://localhost:3000',
...@@ -51,7 +49,7 @@ function Bookmark() { ...@@ -51,7 +49,7 @@ function Bookmark() {
</Navbar> </Navbar>
<Form> <Form>
<ListGroup> <ListGroup>
<ListGroup.Item action href="/">북마크1</ListGroup.Item> <ListGroup.Item action href="">북마크1</ListGroup.Item>
<ListGroup.Item>북마크2</ListGroup.Item> <ListGroup.Item>북마크2</ListGroup.Item>
</ListGroup> </ListGroup>
</Form> </Form>
......
...@@ -2,10 +2,10 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,10 +2,10 @@ import React, { useState, useEffect } from 'react';
import { Link, Redirect } from 'react-router-dom'; import { Link, Redirect } from 'react-router-dom';
import ohuh from './ohuh-sm.PNG'; import ohuh from './ohuh-sm.PNG';
import Place from './Components/Place'; import Place from './Components/Place';
import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Pagination, Nav, Navbar } from 'react-bootstrap'; import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Modal } from 'react-bootstrap';
import Paginations from './pagination.js'; import Paginations from './pagination.js';
import { addFavorite } from './Bookmark.js' import * as Icon from 'react-bootstrap-icons';
import axios from "axios";
function Search(props) { function Search(props) {
const endPage = 10; const endPage = 10;
...@@ -14,6 +14,10 @@ function Search(props) { ...@@ -14,6 +14,10 @@ function Search(props) {
const [showSet, setShowSet] = useState([false, false, false, false]); const [showSet, setShowSet] = useState([false, false, false, false]);
const [search, setSearch] = useState(props.location.state.id); const [search, setSearch] = useState(props.location.state.id);
const [mobile, setMobile] = useState(); const [mobile, setMobile] = useState();
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
useEffect(() => { useEffect(() => {
if (window.innerWidth < 960) { if (window.innerWidth < 960) {
...@@ -28,22 +32,22 @@ function Search(props) { ...@@ -28,22 +32,22 @@ function Search(props) {
address: "제주 서귀포시 토평동 산15-1", address: "제주 서귀포시 토평동 산15-1",
img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAADcCAMAAAC4YpZBAAAAkFBMVEX4ugAAAAD8vQD/vwD/wQAAAAP9vQD2uQCwhAO9jgVAMAbmrANTPwYQDAONaQDQmwN2WQG3iwMyJwZAMACofgMKCAZOOwTHlgGFYwfwtAKYcgYpHwHXoQXepgTorgTxtQJjSgCgeAUgGANwVAUZEwJeRgOKaAR8XQRbRAcnHgQ3KgZPOwGrgQJINQZrUQYeFwOi9fVkAAAIi0lEQVR4nO2b2XaCSBCG6WpaRFTcIoKAIuJu8v5vN72BoOiYnEzEM/XdJEBD+Omllq4YBoIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIIgvwpIXv0W3wUectW0RWNvmJxs13ozpaf2A2zr0hCs8HRmRLP6tJ1bnbSGRnwN8ohuXLQzw3RVvTjt+7T6LGfTvyVpgExg9foUWa4S/P7X7eWOXX3WpO4Z0yaofNiXuUqIP2uvs365N+myrs2x9RJhFZ5T6Q/uNGDl8WjO31ol9AtV42yZLnfjXnGiXZJZ+4wmqTx0ajgMfNkmyidv2o5NSk1w7DQ/dSgWKHBrVZ4bNC/t2KlBKaBb3Whj5W8MC2+kTwb51KSJPO7Ywwpeg1S6D97FP6g2/XIb6ujenOdn9ceYma0KDRD5jErw1rLJvtoGAnXnR95Zllpihw2Yh9fk9vKRyvaHbDKtOjvgaguaqCELYUcexrUPeS1P9CVN1JcYR9U28U4PZK3SkwvvevGfvu/PeGbETpTK1dU6Yg3YB4dttMqhbLaz6p7xYp5Raat5SbbXFw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UxsLOxqPROBtKXwesGT8cL5thLAX0uhKNXsrMwLRCJ7+en4fqCX0aIA7DuIgwKXXCBpXn/xvfqVy7Crh/+U0QBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEGQ/yH/ALoViVlZW8doAAAAAElFTkSuQmCC",
// img: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg?size=200x200", // img: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg?size=200x200",
// }, { // }, {
// name: "성산일출봉(sungsan)", // name: "성산일출봉(sungsan)",
// address: "제주 서귀포시 성산읍 성산리 1", // address: "제주 서귀포시 성산읍 성산리 1",
// img: "https://www.jeju.go.kr/pub/site/geopark/images/sub/sub03/02%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84%EC%9D%B4%EC%95%BC%EA%B8%B0/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84_%EC%84%B1%EC%82%B0%EC%9D%BC%EC%B6%9C%EB%B4%89/1412402261.jpg?400/400", // img: "https://www.jeju.go.kr/pub/site/geopark/images/sub/sub03/02%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84%EC%9D%B4%EC%95%BC%EA%B8%B0/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84/%EC%A7%80%EC%A7%88%EB%A7%88%EC%9D%84_%EC%84%B1%EC%82%B0%EC%9D%BC%EC%B6%9C%EB%B4%89/1412402261.jpg?400/400",
// }, { // }, {
// name: "해녀의 집(haenyeo)", // name: "해녀의 집(haenyeo)",
// address: "제주 서귀포시 성산읍 한도로 141-13지번오조리 3 오조해녀의집", // address: "제주 서귀포시 성산읍 한도로 141-13지번오조리 3 오조해녀의집",
// img: "https://mblogthumb-phinf.pstatic.net/MjAxNjExMTdfMTc0/MDAxNDc5MzU3ODU0ODQy.KZYXCjzsXT3rCsE4HXBfxyCg2buvluBvN_7NxVp7BSwg.loJc89d8JjGXdNCn-4yMd7aMWPjfrZn21TI9Hyzemkog.JPEG.icocam11/20161010_100205.jpg?type=w800", // img: "https://mblogthumb-phinf.pstatic.net/MjAxNjExMTdfMTc0/MDAxNDc5MzU3ODU0ODQy.KZYXCjzsXT3rCsE4HXBfxyCg2buvluBvN_7NxVp7BSwg.loJc89d8JjGXdNCn-4yMd7aMWPjfrZn21TI9Hyzemkog.JPEG.icocam11/20161010_100205.jpg?type=w800",
// }, { // }, {
// name: "오설록 티 뮤지엄(osulloc)", // name: "오설록 티 뮤지엄(osulloc)",
// address: "제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록", // address: "제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록",
// img: "https://cdnweb01.wikitree.co.kr/webdata/editor/202007/01/img_20200701143323_2ced7627.webp", // img: "https://cdnweb01.wikitree.co.kr/webdata/editor/202007/01/img_20200701143323_2ced7627.webp",
// }, { // }, {
// name: "오설록 티 뮤지엄(osulloc)", // name: "오설록 티 뮤지엄(osulloc)",
// address: "제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록", // address: "제주 서귀포시 안덕면 신화역사로 15 오설록지번서광리 1235-1 오설록",
// img: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg", // img: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg/269px-KOCIS_Halla_Mountain_in_Jeju-do_%286387785543%29.jpg",
}] }]
if (state !== false) { if (state !== false) {
...@@ -57,6 +61,9 @@ function Search(props) { ...@@ -57,6 +61,9 @@ function Search(props) {
setIndex(num); setIndex(num);
} }
// async function bookmarkSave() {
// await axios.put('/api/users', {userId:userId, bookmarkId:bookmarkId})
// }
const handleChange = (e) => { const handleChange = (e) => {
setSearch(e.target.value); setSearch(e.target.value);
...@@ -77,81 +84,84 @@ function Search(props) { ...@@ -77,81 +84,84 @@ function Search(props) {
const pagePlace = paginate(places, index, 1) const pagePlace = paginate(places, index, 1)
return ( return (
<Container > <Container >
<Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link> <Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<Row className="mb-2" className="d-flex justify-content-center"> <Row className="mb-2" className="d-flex justify-content-center">
<Form style={{ width: "90vw" }} onSubmit={handleSubmit}> <Form style={{ width: "90vw" }} onSubmit={handleSubmit}>
<InputGroup size="lg"> <InputGroup size="lg">
<Link to="/"> <Link to="/">
<Col> <Col>
{/* <Image src={ohuh} fluid width="130px" /> */} {/* <Image src={ohuh} fluid width="130px" /> */}
</Col> </Col>
</Link> </Link>
<FormControl <FormControl
placeholder="검색어를 입력하세요." placeholder="검색어를 입력하세요."
value={search} value={search}
aria-label="Large" aria-label="Large"
aria-describedby="inputGroup-sizing-sm" aria-describedby="inputGroup-sizing-sm"
onChange={handleChange} onChange={handleChange}
/> />
<InputGroup.Append> <InputGroup.Append>
<Button type="submit" variant="outline-secondary" style={{ maxHeight: "8vh", maxWidth: "14vh" }} >검색</Button> <Button type="submit" variant="outline-secondary" style={{ maxHeight: "8vh", maxWidth: "14vh" }} >검색</Button>
</InputGroup.Append> </InputGroup.Append>
</InputGroup> </InputGroup>
</Form> </Form>
</Row> </Row>
<Row className="d-flex flex-wrap"> <Row className="d-flex flex-wrap">
{pagePlace.map((place, index) => { {pagePlace.map((place, index) => {
return ( return (
<Col key={index} md={6} > <Col key={index} md={6} >
<Card align="center" border="info" style={{ margin: "3%" }}> <Card align="center" border="info" style={{ margin: "3%" }}>
<Card.Title style={{ margin: "3%", fontSize: '200%', fontWeight: 'bold' }}>{place.name}<Button onClick={handleShow}> <Modal <Button variant="outline-info" style={{ marginLeft: "60vh" }} onClick={handleShow}><Icon.BookmarkStar size={30} /> <Modal
show={show} show={show}
onHide={handleClose} onHide={handleClose}
backdrop="static" backdrop="static"
keyboard={false} keyboard={false}
><Form> >
<Form.Group controlId="formBasicEmail"> <Modal.Header closeButton>
<Form.Label>이름</Form.Label> <Modal.Title id="contained-modal-title-vcenter" style={{ fontSize: '30px' }}>북마크 추가됨
<Form.Control type="email" placeholder="Enter email" /> </Modal.Title>
<Form.Text className="text-muted"> </Modal.Header><Form>
We'll never share your email with anyone else. <Form.Group controlId="formBasicEmail">
</Form.Text> <Form.Label style={{ fontSize: '20px' }}>이름</Form.Label>
</Form.Group> <Form.Control type="email" />
<Form.Text className="text-muted">
<Form.Group controlId="formBasicPassword"> </Form.Text>
<Form.Label>폴더</Form.Label> </Form.Group>
<Form.Control type="password" placeholder="Password" />
</Form.Group> {/* <Form.Group controlId="formBasicPassword">
<Form.Group controlId="formBasicCheckbox"> <Form.Label style={{ fontSize: '20px' }}>폴더</Form.Label>
<Form.Check type="checkbox" label="Check me out" /> <Form.Control type="password" placeholder="Password" />
</Form.Group> </Form.Group> */}
<Button variant="primary" type="submit"> <Modal.Footer>
Submit <Button variant="primary" type="submit">저장</Button>
</Button> <Button onClick={props.onHide}>삭제</Button>
</Form></Modal></Button></Card.Title> </Modal.Footer>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} /> </Form></Modal></Button>
<Card.Body > <Card.Title style={{ margin: "3%", fontSize: '200%', fontWeight: 'bold' }}>{place.name}
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > </Card.Title>
{place.address} </Card.Text> <Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} />
<Button variant="primary" onClick={() => { <Card.Body >
const showArr = [false, false, false, false] <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
showArr[index] = true {place.address} </Card.Text>
setShowSet(showArr) <Button variant="primary" onClick={() => {
}}>{place.name} 자세히 살펴보기</Button> const showArr = [false, false, false, false]
<Place search={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} /> showArr[index] = true
</Card.Body> setShowSet(showArr)
}}>{place.name} 자세히 살펴보기</Button>
<Place search={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} />
</Card.Body>
</Card> </Card>
</Col> </Col>
) )
})} })}
</Row> </Row>
{ console.log(showSet) } { console.log(showSet)}
{/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */ } {/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */}
<Row className="mt-2 d-flex justify-content-center"> <Row className="mt-2 d-flex justify-content-center">
<Paginations index={index} endPage={endPage} handlePage={handlePage}></Paginations> <Paginations index={index} endPage={endPage} handlePage={handlePage}></Paginations>
</Row> </Row>
</Container> </Container>
); );
......
...@@ -164,6 +164,11 @@ ...@@ -164,6 +164,11 @@
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
}, },
"bootstrap-icons": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.3.0.tgz",
"integrity": "sha512-w6zQ93p626zmPDqDtET7VdB9EkoDtfmCBV53hunjntoCke6X5LafXf6TxPAP+ImjRAhhxAyA/sjzQnHBY0uoiQ=="
},
"boxen": { "boxen": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz",
...@@ -908,6 +913,11 @@ ...@@ -908,6 +913,11 @@
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
}, },
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"json-buffer": { "json-buffer": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
...@@ -1012,6 +1022,14 @@ ...@@ -1012,6 +1022,14 @@
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
"integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
}, },
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"lowercase-keys": { "lowercase-keys": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
...@@ -1338,6 +1356,16 @@ ...@@ -1338,6 +1356,16 @@
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
}, },
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"proxy-addr": { "proxy-addr": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
...@@ -1401,6 +1429,19 @@ ...@@ -1401,6 +1429,19 @@
"strip-json-comments": "~2.0.1" "strip-json-comments": "~2.0.1"
} }
}, },
"react-bootstrap-icons": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/react-bootstrap-icons/-/react-bootstrap-icons-1.2.3.tgz",
"integrity": "sha512-VPQFuFMVwsK93FTbvE/8InUbX5irc2VlQbCOiMvj80oei6+xek0Q5sOpHPdgVRUn2BeiCAAc9OEOgrebZLWLMA==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"readable-stream": { "readable-stream": {
"version": "2.3.7", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"bootstrap-icons": "^1.3.0",
"cheerio": "^1.0.0-rc.5", "cheerio": "^1.0.0-rc.5",
"express": "^4.17.1", "express": "^4.17.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"mongoose": "^5.11.11", "mongoose": "^5.11.11",
"multer": "^1.4.2", "multer": "^1.4.2",
"nodemon": "^2.0.7", "nodemon": "^2.0.7",
"react-bootstrap-icons": "^1.2.3",
"validator": "^13.5.2" "validator": "^13.5.2"
}, },
"devDependencies": {}, "devDependencies": {},
......
import Review from '../models/Review.js'
import cheerio, { html } from "cheerio";
import jschardet from 'jschardet'
import iconv from 'iconv'
import fs from 'fs'
import axios from 'axios';
import { nextTick } from 'process';
const Iconv = iconv.Iconv
const search = async (req, res, next) => {
// const url = "https://www.google.com/search?q=" + encodeURI(req.params.search) + "+site%3Atistory.com&page_no=1"
const url = "https://www.google.com/search?q=" + encodeURI("한라산") + "+site%3Atistory.com&page_no=1"
let reviews = []
try {
axios.get(url)
// .then(anyToUtf8)
.then((html) => {
const $1 = cheerio.load(html.data);
$1('.kCrYT').each(function (i) {
const searchParams = new URLSearchParams($1(this).find('a').attr('href'));
const title = $1(this).find('h3').text()
const link = searchParams.get("/url?q")
const summary = $1(this).find('.s3v9rd').find('.s3v9rd').text()
const response = axios.get(link)
console.log(response)
// const $2 = cheerio.load(toString(response.data));
let content = "없음"
// if ($2('.tt_article_useless_p_margin').text()) {
// content = $2('.tt_article_useless_p_margin').text()
// }
if (title) {
reviews[i] = { title: title, link: link, content: content }
} else if (summary) {
reviews[i - 1] = { ...reviews[i - 1], summary: summary }
reviews = reviews.filter(e => e)
}
// reviews.forEach((review, i) => {
// axios.get(review.link)
// .then((html) => {
// const $2 = cheerio.load(html.data);
// let content = '없음'
// if ($2('.tt_article_useless_p_margin').text()) {
// content = $2('.tt_article_useless_p_margin').text()
// }
// // fs.writeFileSync(`tistory${i}.txt`, '\ufeff' + html.data, { encoding: 'utf8' });
// // console.log(`${i}번째, ${review.content}`)
// review["content"] = content
// // console.log(review)
// })
// })
// // const review = new Review(reviews).save()
})
res.send(reviews)
})
} catch (error) {
console.log(error)
res.status(500).send('리뷰 저장 에러')
}
}
const getReview = (link) => {
let content = '없음'
const res = axios.get(link)
console.log(res)
// const $2 = cheerio.load(res.data);
// if ($2('.tt_article_useless_p_margin').text()) {
// content = $2('.tt_article_useless_p_margin').text()
// }
console.log(content)
return content
}
export default { search, getReview }
\ No newline at end of file
import Review from '../models/Review.js'
import cheerio, { html } from "cheerio";
import jschardet from 'jschardet'
import iconv from 'iconv'
import fs from 'fs'
import axios from 'axios';
import { nextTick } from 'process';
import { response } from 'express';
const Iconv = iconv.Iconv
const search = async (req, res, next) => {
const url = "https://www.google.com/search?q=" + encodeURI(req.params.search) + "+site%3Atistory.com&page_no=1"
let reviews = []
try {
axios.get(url)
.then((response1) => {
const $1 = cheerio.load(response1.data);
$1('.kCrYT').each(function (i) {
const searchParams = new URLSearchParams($1(this).find('a').attr('href'));
const title = $1(this).find('h3').text()
const link = searchParams.get("/url?q")
const summary = $1(this).find('.s3v9rd').find('.s3v9rd').text()
if (title) {
reviews[i] = { title: title, link: link, }
} else if (summary) {
reviews[i - 1] = { ...reviews[i - 1], summary: summary }
reviews = reviews.filter(e => e)
}
// const review = new Review(reviews).save()
})
res.send(reviews)
})
} catch (error) {
// reviews.forEach((review) => {
// axios.get(review.link)
// .then((response2) => {
// const $2 = cheerio.load(response2.data);
// let content = ''
// if ($2('.tt_article_useless_p_margin').text()) {
// content = $2('.tt_article_useless_p_margin').text()
// }
// review = { content: content }
// console.log("dkssud")
// })
// console.log("dkssud")
// })
// console.log(content)
res.status(500).send(error)
}
}
const getReview = async (link) => {
let content = '없음'
const res = await axios.get(link)
const $2 = cheerio.load(res.data);
if ($2('.tt_article_useless_p_margin').text()) {
content = $2('.tt_article_useless_p_margin').text()
}
console.log(content, "getReiview")
return content
}
export default { search, getReview }
\ No newline at end of file
...@@ -6,53 +6,6 @@ import cheerio from "cheerio"; ...@@ -6,53 +6,6 @@ import cheerio from "cheerio";
import axios from 'axios'; import axios from 'axios';
// const Iconv = iconv.Iconv // const Iconv = iconv.Iconv
// const search = async (req, res) => {
// const url = "https://www.google.com/search?q=" + encodeURI(req.params.search) + "+site%3Atistory.com&page_no=1"
// const editUrl = /(http(s)?:\/\/)([a-z0-9\w]+\.*)+[a-z0-9]{2,4}/gi
// axios.get(url)
// // .then(anyToUtf8)
// .then((html) => {
// // fs.writeFileSync("googlez.txt", '\ufeff' + html, { encoding: 'utf8' });
// let $1 = cheerio.load(html.data);
// let reviews = []
// $1('.kCrYT').each(function (i) {
// let link = ""
// if ($1(this).find('a').attr('href')) {
// link = ($1(this).find('a').attr('href')).match(editUrl)
// }
// reviews[i] = {
// title: $1(this).find('h3').text(),
// link: link,
// summary: $1(this).find('.s3v9rd').text(),
// }
// })
// // reviews.forEach((review, i) => {
// // axios.get(review.link)
// // .then((html) => {
// // let $2 = cheerio.load(html.data);
// // $2('').each(function(i){
// // review.content($2(this).find(''.text()))
// // })
// // })
// // })
// console.log(reviews)
// res.send(reviews)
// })
// // function anyToUtf8(str) {
// // const { encoding } = jschardet.detect(str); // 웹페이지 문서의 인코딩 타입을 확인
// // const iconv = new Iconv(encoding, "utf-8//translit//ignore"); // euc-kr 인코딩변환
// // return iconv.convert(str).toString();
// // }
// // try {
// // const newPlace = await new Place({
// // name: req.params.search,
// // address,
// // img,
// // })
// // }
const search = async (req, res, next) => { const search = async (req, res, next) => {
try { try {
let reviews = [] let reviews = []
......
import mongoose, { isValidObjectId } from "mongoose"; import mongoose, { isValidObjectId } from "mongoose";
const { String } = mongoose.Schema.Types const { String } = mongoose.Schema.Types
const { Array } = mongoose.Schema.Types
const UserSchema = new mongoose.Schema({ const UserSchema = new mongoose.Schema({
name: { name: {
...@@ -23,9 +24,10 @@ const UserSchema = new mongoose.Schema({ ...@@ -23,9 +24,10 @@ const UserSchema = new mongoose.Schema({
default: 'user', default: 'user',
enum: ['user', 'admin', 'root'] enum: ['user', 'admin', 'root']
}, },
// avatarUrl: { bookmark: {
// type: type: Array,
// }, required: true,
}
}, { }, {
timestamps: true timestamps: true
}) })
......
...@@ -5,11 +5,7 @@ const router = express.Router() ...@@ -5,11 +5,7 @@ const router = express.Router()
router.route('/api/users/signup') router.route('/api/users/signup')
.post(userCtrl.signup) .post(userCtrl.signup)
router.route('/api/users/profile/:userId')
.get(userCtrl.getProfile)
.put(userCtrl.profileUpload, userCtrl.update)
router.param('userId', userCtrl.userById) router.param('userId', userCtrl.userById)
export default router export default router
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment