Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LarryLuTW/ptt-daily-beauty
/ functions
Functions
46 in github.com/LarryLuTW/ptt-daily-beauty
⨍
Functions
46
◇
Types & classes
2
↓ 5 callers
Function
GetEmails
GetEmails get all emails in the database
db/db.go:63
↓ 5 callers
Function
InsertAEmail
InsertAEmail save a email into the database
db/db.go:39
↓ 4 callers
Function
RemoveAEmail
RemoveAEmail removes a email from database
db/db.go:56
↓ 3 callers
Method
ToBeauty
ToBeauty transform a Post to a Beauty
model/post.go:68
↓ 3 callers
Function
countEmailInSlice
(s []string, email string)
db/db_test.go:7
↓ 2 callers
Function
FetchPage
FetchPage get all posts in a page
ptt/api/api.go:37
↓ 2 callers
Function
FetchPageAmount
FetchPageAmount get latest page number
ptt/api/api.go:14
↓ 2 callers
Function
Search
Search use PTT search to get search result sometimes PTT cache search result
ptt/api/api.go:58
↓ 2 callers
Function
parseDoc2Posts
(doc *goquery.Document, prefix string)
ptt/api/parser.go:35
↓ 2 callers
Function
sendDailyBeauty
(subscribers []string, isTest bool)
main.go:23
↓ 1 callers
Function
FetchBeauties
FetchBeauties send a request to get beauties from getDailyBeauties api
ptt/ptt.go:91
↓ 1 callers
Function
FetchRandomBeauty
FetchRandomBeauty randomly fetch a model.Beauty
ptt/ptt.go:53
↓ 1 callers
Function
GenerateHTML
GenerateHTML generates a html from beauties slice
mail/mail.go:50
↓ 1 callers
Function
NewToken
NewToken accept a email and generate a token
jwt/jwt.go:31
↓ 1 callers
Function
ParseToken
ParseToken parse a token string and get email
jwt/jwt.go:12
↓ 1 callers
Function
Send
Send sends the html to the receiver
mail/mail.go:34
↓ 1 callers
Function
checkExist
(email string)
db/db.go:32
↓ 1 callers
Function
createMsg
(to, subject, html string)
mail/mail.go:19
↓ 1 callers
Function
fetchImageAmount
fetchImageAmount get the amount of images in a post
model/post.go:36
↓ 1 callers
Function
fetchPreviewImg
fetchPreviewImg get the preview image of a post
model/post.go:21
↓ 1 callers
Function
fetchYesterdayPosts
()
ptt/ptt.go:17
↓ 1 callers
Function
getBestBeauties
(posts []model.Post)
ptt/ptt.go:68
↓ 1 callers
Function
isBeforeYesterday
(t time.Time)
ptt/time.go:18
↓ 1 callers
Function
isYesterday
(t time.Time)
ptt/time.go:11
↓ 1 callers
Function
parseNVote
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 callers
Function
reverse
(bs []model.Beauty)
mail/mail.go:40
↓ 1 callers
Function
transformURL
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 callers
Function
trimTitlePrefix
"[正妹] 大橋未久" -> "大橋未久"
model/post.go:55
Function
TestFetchPage
(t *testing.T)
ptt/api/api_test.go:18
Function
TestFetchPageAmount
(t *testing.T)
ptt/api/api_test.go:8
Function
TestInsertADuplicateEmail
(t *testing.T)
db/db_test.go:32
Function
TestInsertANewEmail
(t *testing.T)
db/db_test.go:16
Function
TestPostToBeauty
(t *testing.T)
model/post_test.go:8
Function
TestRemoveAEmail
(t *testing.T)
db/db_test.go:52
Function
TestSearch
(t *testing.T)
ptt/api/api_test.go:32
Function
emailsHandler
(c *gin.Context)
main.go:102
Function
homePageHandler
(c *gin.Context)
main.go:110
Function
init
TODO: split ptt api layer and utils layer
ptt/ptt.go:13
Function
init
init mongodb connection
db/db.go:19
Function
isToday
(t time.Time)
ptt/time.go:5
Function
main
()
main.go:123
Function
pttRedirectHandler
Redirect /ptt/redirect/M.1543991133.A.1A1 to https://www.ptt.cc/bbs/Beauty/M.1543991133.A.1A1.html
main.go:116
Function
publishHandler
(c *gin.Context)
main.go:63
Function
subscribeHandler
(c *gin.Context)
main.go:74
Function
testHandler
(c *gin.Context)
main.go:56
Function
unsubscribeHandler
api/unsubscribe?token={jwt_token}
main.go:87