Documentation
¶
Index ¶
- Variables
- func GetPlurkSearch(w http.ResponseWriter, r *http.Request)
- func GetPlurkTop(w http.ResponseWriter, r *http.Request)
- func GetPttSearch(w http.ResponseWriter, r *http.Request)
- func GetPttTrending(w http.ResponseWriter, r *http.Request)
- func ProcessPlurkSearch(keyword string) (string, error)
- func ProcessPlurkTop(qType string) (string, error)
- type Article
- type Comment
- type Plurk
- type PredictRequest
- type PredictResponse
- type PttParser
- type StatEntry
- type Stats
- type TrendingArticle
Constants ¶
This section is empty.
Variables ¶
View Source
var PredictServiceURL = getEnvOrDefault("PREDICT_SERVICE_URL", "http://localhost:5000")
PredictService URL (configured via environment variable)
Functions ¶
func GetPlurkSearch ¶
func GetPlurkSearch(w http.ResponseWriter, r *http.Request)
Cloud Functions handlers
func GetPlurkTop ¶
func GetPlurkTop(w http.ResponseWriter, r *http.Request)
func GetPttSearch ¶
func GetPttSearch(w http.ResponseWriter, r *http.Request)
Cloud Functions handler
func GetPttTrending ¶
func GetPttTrending(w http.ResponseWriter, r *http.Request)
GetPttTrending handles GET /ptt/trending?board=C_Chat&threshold=0.6&mode=all mode: "viral" (已爆文), "potential" (潛在爆文), "all" (兩者都要, 預設)
func ProcessPlurkSearch ¶
func ProcessPlurkTop ¶
Types ¶
type PredictRequest ¶
type PredictRequest struct {
Board string `json:"board"`
Title string `json:"title"`
PostTime string `json:"post_time"`
CommentsWindow int `json:"comments_window"`
PushWindow int `json:"push_window"`
BooWindow int `json:"boo_window"`
HourOfDay int `json:"hour_of_day"`
DayOfWeek int `json:"day_of_week"`
TitleLength int `json:"title_length"`
HasImage bool `json:"has_image"`
TagType string `json:"tag_type"`
}
PredictRequest matches the FastAPI service request schema
type PredictResponse ¶
type PredictResponse struct {
Probability float64 `json:"probability"`
}
PredictResponse from the FastAPI service
Click to show internal directories.
Click to hide internal directories.