Compare commits

..
3 Commits
Author SHA1 Message Date
Hadi 2d01c1639f Fix isDir condition
Signed-off-by: Hadi <[email protected]>
2025-09-17 19:47:50 +02:00
Hadi 66030c1c16 add details to close friends
Signed-off-by: Hadi <[email protected]>
2025-09-17 19:31:54 +02:00
Hadi bb8f34055d fix nixos installation step
Signed-off-by: Hadi <[email protected]>
2025-09-16 19:35:38 +02:00
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ nix run github:anotherhadi/github-recon -- [--flags value] target_username_or_em
# then add it to your packages
environment.systemPackages = with pkgs; [ # or home.packages
github-recon
inputs.github-recon.defaultPackage.${pkgs.system}
];
```
+17
View File
@@ -13,7 +13,11 @@ import (
type CloseFriendsResult []CloseFriendResult
type CloseFriendResult struct {
Name string
Username string
Orgs []string
Company string
Location string
Score int
}
@@ -96,8 +100,12 @@ func CloseFriends(s github_recon_settings.Settings) (results CloseFriendsResult)
// Add candidate if they matched at least one condition
if score > 0 {
results = append(results, CloseFriendResult{
Name: candidateDetails.GetName(),
Username: candidateLogin,
Orgs: candidateOrgsToNames(candidateOrgs),
Score: score,
Location: candidateDetails.GetLocation(),
Company: candidateDetails.GetCompany(),
})
}
}
@@ -130,6 +138,15 @@ func checkIfUserFollows(s github_recon_settings.Settings, sourceUser, targetUser
}
return isFollowing, nil
}
func candidateOrgsToNames(orgs []*github.Organization) []string {
var orgNames []string
for _, org := range orgs {
if org.GetLogin() != "" {
orgNames = append(orgNames, org.GetLogin())
}
}
return orgNames
}
func getOrgs(s github_recon_settings.Settings, user string) ([]*github.Organization, error) {
orgs, resp, err := s.Client.Organizations.List(s.Ctx, user, nil)
+2 -2
View File
@@ -334,13 +334,13 @@ func findEmailsAndOccurrencesInDir(rootPath string, username string) (Emails, er
if err != nil {
return err
}
if !d.IsDir() {
if d.Type().IsRegular() {
if strings.Contains(path, ".git/logs/") {
return nil
}
content, err := os.ReadFile(path)
if err != nil {
return err
return nil
}
currentFileEmails := emailRegex.FindAllString(string(content), -1)