mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
add localtime
This commit is contained in:
@@ -21,6 +21,7 @@ type User struct {
|
||||
Bio string
|
||||
AvatarUrl string
|
||||
Location string
|
||||
Timezone string
|
||||
Following int64
|
||||
Followers int64
|
||||
Link string
|
||||
@@ -138,6 +139,7 @@ func HandleUser(c *fiber.Ctx) error {
|
||||
// Metadata (Location/Workplace/Website/Twitter etc.)
|
||||
sc.OnHTML("ul.vcard-details", func(e *colly.HTMLElement) {
|
||||
Scrape.Location = e.ChildText("li[itemprop*='homeLocation'] span")
|
||||
Scrape.Timezone = e.ChildText("li[itemprop*='localTime'] span")
|
||||
Scrape.Company = e.ChildText("li[itemprop*='worksFor'] span")
|
||||
Scrape.EwTwitter = e.ChildText("a[href*='https://twitter.com/' i]")
|
||||
})
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
{{ end }}
|
||||
{{ if .Timezone }}
|
||||
<p>🕑️ {{.Timezone}}</p>
|
||||
{{ end }}
|
||||
{{ if .Link }}
|
||||
<p>🔗 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user