mirror of
https://github.com/anotherhadi/gravatar-recon.git
synced 2026-10-05 11:18:24 +02:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b908c870f | ||
|
|
e74f69daf7 |
+4
-1
@@ -58,12 +58,15 @@ func main() {
|
||||
}
|
||||
|
||||
profiles, err := gravatar_recon.GetGravatarProfiles(email)
|
||||
if err != nil {
|
||||
if err != nil || profiles == nil {
|
||||
log.Fatal("Failed to get Gravatar profile", "err", err)
|
||||
}
|
||||
|
||||
if !*silent {
|
||||
utils.Header()
|
||||
if len(*profiles) == 0 {
|
||||
utils.PrintNoResultFound()
|
||||
}
|
||||
for _, profile := range *profiles {
|
||||
utils.PrintTitle(profile.PreferredUser + ":")
|
||||
if *printAvatar {
|
||||
|
||||
@@ -23,6 +23,6 @@ require (
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/image v0.28.0 // indirect
|
||||
golang.org/x/image v0.38.0 // indirect
|
||||
golang.org/x/sys v0.30.0 // indirect
|
||||
)
|
||||
|
||||
@@ -39,8 +39,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
|
||||
golang.org/x/image v0.28.0 h1:gdem5JW1OLS4FbkWgLO+7ZeFzYtL3xClb97GaUzYMFE=
|
||||
golang.org/x/image v0.28.0/go.mod h1:GUJYXtnGKEUgggyzh+Vxt+AviiCcyiwpsl8iQ8MvwGY=
|
||||
golang.org/x/image v0.38.0 h1:5l+q+Y9JDC7mBOMjo4/aPhMDcxEptsX+Tt3GgRQRPuE=
|
||||
golang.org/x/image v0.38.0/go.mod h1:/3f6vaXC+6CEanU4KJxbcUZyEePbyKbaLoDOe4ehFYY=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
|
||||
@@ -91,6 +91,10 @@ func GetGravatarProfiles(email string) (*[]GravatarProfile, error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == 404 {
|
||||
return &[]GravatarProfile{}, nil
|
||||
}
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
return nil, fmt.Errorf("no gravatar profile found (status %d)", resp.StatusCode)
|
||||
}
|
||||
|
||||
@@ -133,6 +133,10 @@ func PrintTitle(title string) {
|
||||
fmt.Println(titleStyle.Render(title) + "\n")
|
||||
}
|
||||
|
||||
func PrintNoResultFound() {
|
||||
fmt.Println(titleStyle.Render("No result found"))
|
||||
}
|
||||
|
||||
func PrintAvatar(url string) {
|
||||
if url == "" {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user