User contributions
このコミットが含まれているのは:
コミット
24cefa1afa
|
@ -16,18 +16,19 @@ import (
|
|||
)
|
||||
|
||||
type User struct {
|
||||
Login string
|
||||
Name string
|
||||
Bio string
|
||||
AvatarUrl string
|
||||
Location string
|
||||
Following int64
|
||||
Followers int64
|
||||
Link string
|
||||
Company string
|
||||
Type string
|
||||
EwTwitter string
|
||||
Readme string
|
||||
Login string
|
||||
Name string
|
||||
Bio string
|
||||
AvatarUrl string
|
||||
Location string
|
||||
Following int64
|
||||
Followers int64
|
||||
Link string
|
||||
Company string
|
||||
Type string
|
||||
EwTwitter string
|
||||
Contributions string
|
||||
Readme string
|
||||
}
|
||||
|
||||
type Ratelimit struct {
|
||||
|
@ -152,6 +153,10 @@ func HandleUser(c *fiber.Ctx) error {
|
|||
Scrape.Login = e.ChildText("span[itemprop*='additionalName']")
|
||||
Scrape.Name = e.ChildText("span[itemprop*='name']")
|
||||
})
|
||||
// Contributions
|
||||
sc.OnHTML("div.js-yearly-contributions", func(e *colly.HTMLElement) {
|
||||
Scrape.Contributions = e.ChildText("h2")
|
||||
})
|
||||
} else {
|
||||
sc.OnHTML("img[alt*='@"+c.Params("user")+"' i]", func(e *colly.HTMLElement) {
|
||||
Scrape.AvatarUrl = e.Attr("src")
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
{{ if .Location }}
|
||||
<p>🌍 {{.Location}}</p>
|
||||
{{ end }}
|
||||
{{ if .Timezone }}
|
||||
<p>🕑️ {{.Timezone}}</p>
|
||||
{{ if .Link }}
|
||||
<p>🔗 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
|
||||
{{ end }}
|
||||
|
@ -29,6 +31,9 @@
|
|||
{{ if .EwTwitter }}
|
||||
<p>🐦 <a href="https://twitter.com/{{.EwTwitter}}" target="_blank">{{.EwTwitter}}</a></p>
|
||||
{{ end }}
|
||||
{{ if eq .Type "http://schema.org/Person" }}
|
||||
<p>✏️ {{ if .Name }} {{.Name}} {{ else }} {{.Login}} {{ end }} has made {{.Contributions}}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ if .Bio }}
|
||||
|
|
読み込み中…
新しいイシューから参照