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.

24 lines
537 B

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