Skip to content

Commit

Permalink
Convert letter with an access to the letter without (é -> e)
Browse files Browse the repository at this point in the history
  • Loading branch information
nodauf committed Jan 20, 2022
1 parent 563db52 commit e22f563
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ go 1.16

require (
github.com/fatih/color v1.13.0
github.com/mozillazg/go-unidecode v0.1.1
github.com/spf13/cobra v1.2.1
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mozillazg/go-unidecode v0.1.1 h1:uiRy1s4TUqLbcROUrnCN/V85Jlli2AmDF6EeAXOeMHE=
github.com/mozillazg/go-unidecode v0.1.1/go.mod h1:fYMdhyjni9ZeEmS6OE/GJHDLsF8TQvIVDwYR/drR26Q=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
4 changes: 3 additions & 1 deletion src/linkedin/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"net/url"
"strconv"
"strings"

"github.com/mozillazg/go-unidecode"
)

// getCompany return a struct that contains all the company of the research
Expand Down Expand Up @@ -80,7 +82,7 @@ func (options *Options) getPeople(companyID, start int) []string {
email = strings.ReplaceAll(email, "{f}", name[0][0:1])
email = strings.ReplaceAll(email, "{last}", name[1])
email = strings.ReplaceAll(email, "{l}", name[1][0:1])
email = strings.ToLower(email)
email = strings.ToLower(unidecode.Unidecode(email))
log.Success(email + " - " + people.PrimarySubtitle.Text + " - " + people.SecondarySubtitle.Text)
output = append(output, email)
}
Expand Down
4 changes: 3 additions & 1 deletion src/searchEngine/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"regexp"
"strconv"
"strings"

"github.com/mozillazg/go-unidecode"
)

// SEARCH_ENGINE contains url for search on Google and Bing
Expand Down Expand Up @@ -83,7 +85,7 @@ func (options *Options) Gather() []string {
email = strings.ReplaceAll(email, "{f}", result["FirstName"][0:1])
email = strings.ReplaceAll(email, "{last}", result["LastName"])
email = strings.ReplaceAll(email, "{l}", result["LastName"][0:1])
email = strings.ToLower(email)
email = strings.ToLower(unidecode.Unidecode(email))
log.Success(email)
output = append(output, email)
nbFoundEmail += 1
Expand Down

0 comments on commit e22f563

Please sign in to comment.