Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이해님
/
term-project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yulim KIM
2020-12-07 00:59:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
23f81e9672f13ec11051bdfed5919debbf8efb16
23f81e96
1 parent
5df625c5
modified
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
twitter-controller.js
twitter-controller.js
View file @
23f81e9
...
...
@@ -15,7 +15,7 @@ exports.getUserTweets = async function(req, res){
if
(
!
error
){
console
.
log
(
tweets
);
//가져온 타임라인 내용 콘솔창에 출력
res
.
render
(
'timeline.html'
,
tweets
);
//timeline.html 화면에 뿌려줌 그리고 tweets값을 저 페이지로 보냄
res
.
render
(
'timeline.html'
,
{
tweets
}
);
//timeline.html 화면에 뿌려줌 그리고 tweets값을 저 페이지로 보냄
}
});
//아이디를 토대로 타임라인 가져오기
...
...
@@ -25,12 +25,15 @@ exports.getUserTweets = async function(req, res){
res
.
sendStatus
(
500
);
}
}
//찾고싶은 게시물내용검색
exports
.
getUserSearch
=
async
function
(
req
,
res
){
try
{
let
searchdata
=
client
.
get
(
'search/tweets'
,
req
.
params
,
function
(
error
,
tweets
,
response
)
{
//search
let
searchdata
=
client
.
get
(
'search/tweets'
,
{
q
:
'now'
},
function
(
error
,
tweets2
,
response
)
{
//search
if
(
!
error
){
console
.
log
(
tweets
);
res
.
render
(
'timeline.html'
,
tweets
);
console
.
log
(
tweets
2
);
res
.
render
(
'timeline.html'
,
{
tweets2
}
);
}
});
//입력값 바꿀 필요 있음(?)
...
...
@@ -41,15 +44,17 @@ exports.getUserSearch = async function(req, res){
}
//인기있는 게시물(리트윗)
exports
.
getUserRetweet
=
async
function
(
req
,
res
){
try
{
let
retweetdata
=
client
.
get
(
'statuses/user_timeline'
,
req
.
params
,
function
(
error
,
tweets
,
response
)
{
//리트윗
let
retweetdata
=
client
.
get
(
'statuses/user_timeline'
,
req
.
params
,
function
(
error
,
tweets
3
,
response
)
{
if
(
!
error
){
tweets
.
sort
(
function
(
a
,
b
){
tweets
3
.
sort
(
function
(
a
,
b
){
return
b
.
retweet_count
-
a
.
retweet_count
;
});
//리트윗 data 내림차순로 정렬(?)
console
.
log
(
tweets
);
res
.
render
(
'
timeline.html'
,
tweets
);
console
.
log
(
tweets
3
);
res
.
render
(
'
popular.html'
,{
tweets3
}
);
}
});
...
...
Please
register
or
login
to post a comment