VOA Learning English

This commit is contained in:
xing 2023-04-14 14:02:35 +08:00
parent 3c18e81205
commit 93fd4d4a2e

View File

@ -81,6 +81,12 @@ func theNewYorker(w http.ResponseWriter, r *http.Request) {
})) }))
} }
func voaLearnEnglish(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, fetch("https://feedx.best/rss/voalearningenglish.xml", func(s string) string {
return filterItem(s, time.Now().Day(), 1)
}))
}
func main() { func main() {
port := os.Getenv("port") port := os.Getenv("port")
if port == "" { if port == "" {
@ -92,5 +98,6 @@ func main() {
http.HandleFunc("/tjxz", tjxz) //田间小站 http.HandleFunc("/tjxz", tjxz) //田间小站
http.HandleFunc("/bbcLearn", bbcLearn) //bbc 英语学习 http.HandleFunc("/bbcLearn", bbcLearn) //bbc 英语学习
http.HandleFunc("/theNewYorker", theNewYorker) //纽约客 http.HandleFunc("/theNewYorker", theNewYorker) //纽约客
http.HandleFunc("/voaLearnEnglish", voaLearnEnglish) //VOA Learning English
log.Fatal(http.ListenAndServe(port, nil)) log.Fatal(http.ListenAndServe(port, nil))
} }