go colly 爬虫博客到wordpress https://www.aispider.cc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
537 B

package spider
import (
"go-wordpress-xmlrpc/wordpress"
"log"
)
func saveBlog(title string, content string, postDate string, tags []string, catelogs []string) {
c, err := NewClient(`http://49.235.160.131/xmlrpc.php`, UserInfo{
//c, err := NewClient(`https://www.aispider.cc/xmlrpc.php`, UserInfo{
`你的账户`,
`你的密码`,
})
if err != nil {
log.Fatalln(err)
}
p := wordpress.NewPost(title, content, postDate, tags, catelogs)
blogID, err := c.Call(p)
if err != nil {
log.Println(err)
}
log.Println(blogID)
}