MCPcopy Create free account

hub / github.com/LarryLuTW/ptt-daily-beauty / functions

Functions46 in github.com/LarryLuTW/ptt-daily-beauty

↓ 5 callersFunctionGetEmails
GetEmails get all emails in the database
db/db.go:63
↓ 5 callersFunctionInsertAEmail
InsertAEmail save a email into the database
db/db.go:39
↓ 4 callersFunctionRemoveAEmail
RemoveAEmail removes a email from database
db/db.go:56
↓ 3 callersMethodToBeauty
ToBeauty transform a Post to a Beauty
model/post.go:68
↓ 3 callersFunctioncountEmailInSlice
(s []string, email string)
db/db_test.go:7
↓ 2 callersFunctionFetchPage
FetchPage get all posts in a page
ptt/api/api.go:37
↓ 2 callersFunctionFetchPageAmount
FetchPageAmount get latest page number
ptt/api/api.go:14
↓ 2 callersFunctionSearch
Search use PTT search to get search result sometimes PTT cache search result
ptt/api/api.go:58
↓ 2 callersFunctionparseDoc2Posts
(doc *goquery.Document, prefix string)
ptt/api/parser.go:35
↓ 2 callersFunctionsendDailyBeauty
(subscribers []string, isTest bool)
main.go:23
↓ 1 callersFunctionFetchBeauties
FetchBeauties send a request to get beauties from getDailyBeauties api
ptt/ptt.go:91
↓ 1 callersFunctionFetchRandomBeauty
FetchRandomBeauty randomly fetch a model.Beauty
ptt/ptt.go:53
↓ 1 callersFunctionGenerateHTML
GenerateHTML generates a html from beauties slice
mail/mail.go:50
↓ 1 callersFunctionNewToken
NewToken accept a email and generate a token
jwt/jwt.go:31
↓ 1 callersFunctionParseToken
ParseToken parse a token string and get email
jwt/jwt.go:12
↓ 1 callersFunctionSend
Send sends the html to the receiver
mail/mail.go:34
↓ 1 callersFunctioncheckExist
(email string)
db/db.go:32
↓ 1 callersFunctioncreateMsg
(to, subject, html string)
mail/mail.go:19
↓ 1 callersFunctionfetchImageAmount
fetchImageAmount get the amount of images in a post
model/post.go:36
↓ 1 callersFunctionfetchPreviewImg
fetchPreviewImg get the preview image of a post
model/post.go:21
↓ 1 callersFunctionfetchYesterdayPosts
()
ptt/ptt.go:17
↓ 1 callersFunctiongetBestBeauties
(posts []model.Post)
ptt/ptt.go:68
↓ 1 callersFunctionisBeforeYesterday
(t time.Time)
ptt/time.go:18
↓ 1 callersFunctionisYesterday
(t time.Time)
ptt/time.go:11
↓ 1 callersFunctionparseNVote
parseNVote parses vote text to int "50" => 50, "爆" => 100 "" => 0 "X7" => -1 there is no need to handle nVote <= 0 because they are filterer out when
ptt/api/parser.go:21
↓ 1 callersFunctionreverse
(bs []model.Beauty)
mail/mail.go:40
↓ 1 callersFunctiontransformURL
transform https://www.ptt.cc/bbs/Beauty/M.1543991133.A.1A1.html to https://daily-beauty.xyz/ptt/redirect/M.1543991133.A.1A1
model/post.go:61
↓ 1 callersFunctiontrimTitlePrefix
"[正妹] 大橋未久" -> "大橋未久"
model/post.go:55
FunctionTestFetchPage
(t *testing.T)
ptt/api/api_test.go:18
FunctionTestFetchPageAmount
(t *testing.T)
ptt/api/api_test.go:8
FunctionTestInsertADuplicateEmail
(t *testing.T)
db/db_test.go:32
FunctionTestInsertANewEmail
(t *testing.T)
db/db_test.go:16
FunctionTestPostToBeauty
(t *testing.T)
model/post_test.go:8
FunctionTestRemoveAEmail
(t *testing.T)
db/db_test.go:52
FunctionTestSearch
(t *testing.T)
ptt/api/api_test.go:32
FunctionemailsHandler
(c *gin.Context)
main.go:102
FunctionhomePageHandler
(c *gin.Context)
main.go:110
Functioninit
TODO: split ptt api layer and utils layer
ptt/ptt.go:13
Functioninit
init mongodb connection
db/db.go:19
FunctionisToday
(t time.Time)
ptt/time.go:5
Functionmain
()
main.go:123
FunctionpttRedirectHandler
Redirect /ptt/redirect/M.1543991133.A.1A1 to https://www.ptt.cc/bbs/Beauty/M.1543991133.A.1A1.html
main.go:116
FunctionpublishHandler
(c *gin.Context)
main.go:63
FunctionsubscribeHandler
(c *gin.Context)
main.go:74
FunctiontestHandler
(c *gin.Context)
main.go:56
FunctionunsubscribeHandler
api/unsubscribe?token={jwt_token}
main.go:87