Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5710dc commit df7b37dCopy full SHA for df7b37d
websites/code/studygolang/src/service/project.go
@@ -292,6 +292,11 @@ func ParseOneProject(projectUrl string) error {
292
return errors.New("url" + projectUrl + "has exists!")
293
}
294
295
+ logoSelection := doc.Find(".Project .PN img")
296
+ if logoSelection.AttrOr("title", "") != "" {
297
+ project.Logo = logoSelection.AttrOr("src", "")
298
+ }
299
+
300
// 获取项目相关链接
301
doc.Find("#Body .urls li").Each(func(i int, liSelection *goquery.Selection) {
302
aSelection := liSelection.Find("a")
@@ -343,8 +348,6 @@ func ParseOneProject(projectUrl string) error {
343
348
project.Author = "网友"
344
349
345
350
346
- // TODO: logo
347
-
351
if project.Doc == "" {
352
// TODO:暂时认为一定是 Go 语言
353
project.Doc = "https://godoc.org/" + project.Src[8:]
0 commit comments