Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2_open_source_sw_development_Han
/
Jaksimsamil
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
JaeHyeok Song
2020-12-09 12:25:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c0272b55b87ef819a7e16816f87625fb1fe50fe
8c0272b5
1 parent
71a2f4a4
remove unneccesary content
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
jaksimsamil-page/src/components/setting/215xiena.png
jaksimsamil-page/src/scripts/getRecommend.js
jaksimsamil-page/src/components/setting/215xiena.png
deleted
100644 → 0
View file @
71a2f4a
1.24 KB
jaksimsamil-page/src/scripts/getRecommend.js
View file @
8c0272b
const
app
=
require
(
'koa'
)
function
getRecommend
(
auth
)
{
console
.
log
(
"login success"
,
auth
);
const
host
=
'http://localhost:23023'
;
const
host
=
'http
s
://localhost:23023'
;
const
url
=
host
+
"/api/profile/recommend"
;
const
data
=
{
username
:
'test'
};
window
.
fetch
(
url
,
{
method
:
"POST"
,
...
...
@@ -16,10 +18,31 @@ function getRecommend(auth) {
})
.
then
(
shareToKakao
);
}
const
TOKEN
=
'tdN03DyXDAcKGZsuiPndaU7UC2GzuEQYUhPCkDnGWXGGdiPmV15QYbFU1U5JP5EpiETIKLqOmci/RxFZTfD7FRMED0OpT+3qgEYBNf8T9/jRzHRm7rblBLtzFBVOeXeYRcluOsz4koE4JaAJaUtMtwdB04t89/1O/w1cDnyilFU='
function
shareToKakao
({
problem_number
,
problem_title
,
solved_date
})
{
console
.
log
(
'getting ready to share...'
);
const
boj_link
=
"https://acmicpc.net/problem/"
+
problem_number
.
toString
();
window
.
fetch
(
'https://www.osstest17.ml:23023/hook'
,
{
method
:
"POST"
,
body
:
JSON
.
stringify
(
data
),
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
"Hello, user"
},
{
"type"
:
"text"
,
"text"
:
"May I help you?"
}
]
}
})
window
.
Kakao
.
Link
.
sendDefault
({
objectType
:
'text'
,
text
:
`오늘의 추천문제는
${
problem_title
}
`
,
...
...
@@ -29,7 +52,6 @@ function shareToKakao({problem_number, problem_title, solved_date}) {
}
});
}
export
{
getRecommend
as
default
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment