add localtime

This commit is contained in:
Arya Kiran
2023-02-08 19:25:03 +05:30
parent 24cefa1afa
commit 7a130bf8cc
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -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]")
})
+1
View File
@@ -22,6 +22,7 @@
{{ end }}
{{ if .Timezone }}
<p>🕑️ {{.Timezone}}</p>
{{ end }}
{{ if .Link }}
<p>🔗 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
{{ end }}