Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건
/
Comment_Analysis
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
HyoJoon
2019-11-25 22:33:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f0ea8d9df3d565a8a3476a78556f1842118daba6
f0ea8d9d
1 parent
35aa8910
검색 속도 향상을 위해 최대 검색 갯수 제한
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
twitter/Further.md
twitter/now.md
twitter/twitter.py
twitter/Further.md
deleted
100644 → 0
View file @
35aa891
검색 시간 빠르게 하는 것 구현
node js 구현 시작
\ No newline at end of file
twitter/now.md
View file @
f0ea8d9
이전 구현에서 나아가 중복제거 구현
추가적으로 닉네임, 날짜, 검색어를 서로 연관시켜
검색할 수 있게함
\ No newline at end of file
현재 검색 기능 구현 완료와 더불어
검색 속도 향상 완료
\ No newline at end of file
...
...
twitter/twitter.py
View file @
f0ea8d9
...
...
@@ -33,8 +33,8 @@ def get_tweets(criteria):
print
(
"===================================="
)
days_range
=
[]
start
=
datetime
.
datetime
.
strptime
(
"2019-11-
17
"
,
"
%
Y-
%
m-
%
d"
)
end
=
datetime
.
datetime
.
strptime
(
"2019-11-
18
"
,
"
%
Y-
%
m-
%
d"
)
start
=
datetime
.
datetime
.
strptime
(
"2019-11-
25
"
,
"
%
Y-
%
m-
%
d"
)
end
=
datetime
.
datetime
.
strptime
(
"2019-11-
26
"
,
"
%
Y-
%
m-
%
d"
)
date_generated
=
[
start
+
datetime
.
timedelta
(
days
=
x
)
for
x
in
range
(
0
,
(
end
-
start
)
.
days
)]
for
date
in
date_generated
:
...
...
@@ -53,6 +53,7 @@ while(True):
temp1
=
"현재 검색어는 "
+
my_key
+
"입니다. "
print
(
temp1
)
print
(
"기간은 기본적으로 최근 1일입니다."
)
print
(
"빠른 검색을 지원하기 위해 최대 50건까지만 표시됩니다."
)
print
(
"1. 닉네임을 통한 검색"
)
print
(
"2. 키워드를 통한 검색"
)
print
(
"3. 시간을 통한 검색"
)
...
...
@@ -62,7 +63,7 @@ while(True):
if
userNum
==
1
:
nick
=
input
(
"검색할 닉네임을 입력해주세요: "
)
print
(
"1. 최근 10개만 보기"
)
print
(
"2. 해당 닉네임의 트윗
전부 다
보기"
)
print
(
"2. 해당 닉네임의 트윗
50건
보기"
)
print
(
"3. 현재 검색어를 적용시켜 보기"
)
tweetNum
=
int
(
input
(
"무엇을 하시겠습니까?: "
))
if
(
tweetNum
==
1
):
...
...
@@ -75,14 +76,14 @@ while(True):
tweetCriteria
=
got
.
manager
.
TweetCriteria
()
.
setUsername
(
nick
)
\
.
setSince
(
start_date
)
\
.
setUntil
(
end_date
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
get_tweets
(
tweetCriteria
)
elif
(
tweetNum
==
3
):
tweetCriteria
=
got
.
manager
.
TweetCriteria
()
.
setUsername
(
nick
)
\
.
setQuerySearch
(
my_key
)
\
.
setSince
(
start_date
)
\
.
setUntil
(
end_date
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
get_tweets
(
tweetCriteria
)
else
:
print
(
"잘못된 보기를 선택하셨습니다."
)
...
...
@@ -91,7 +92,7 @@ while(True):
tweetCriteria
=
got
.
manager
.
TweetCriteria
()
.
setQuerySearch
(
my_key
)
\
.
setSince
(
start_date
)
\
.
setUntil
(
end_date
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
get_tweets
(
tweetCriteria
)
elif
userNum
==
3
:
user_start
=
int
(
input
(
"시작일을 입력해주세요(yyyymmdd형태): "
))
...
...
@@ -132,12 +133,12 @@ while(True):
.
setQuerySearch
(
my_key
)
\
.
setSince
(
d1
)
\
.
setUntil
(
d3
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
elif
(
myNum1
==
2
):
tweetCriteria
=
got
.
manager
.
TweetCriteria
()
.
setQuerySearch
(
my_key
)
\
.
setSince
(
d1
)
\
.
setUntil
(
d3
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
else
:
print
(
"잘못된 입력입니다."
)
continue
...
...
@@ -152,12 +153,12 @@ while(True):
.
setQuerySearch
(
my_key
)
\
.
setSince
(
d1
)
\
.
setUntil
(
d3
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
elif
(
myNum2
==
2
):
tweetCriteria
=
got
.
manager
.
TweetCriteria
()
.
setQuerySearch
(
my_key
)
\
.
setSince
(
d1
)
\
.
setUntil
(
d3
)
\
.
setMaxTweets
(
-
1
)
.
setMaxTweets
(
50
)
else
:
print
(
"잘못된 입력입니다."
)
continue
...
...
Please
register
or
login
to post a comment