Documentation ¶
Index ¶
- Variables
- func RemoveExtension(input, extension string) string
- func ScrapeBioTwitterTag(response http.Response) (string, error)
- func ScrapeImageTwitterTag(response http.Response) (string, error)
- func ServicesCheckWorker(s <-chan UserServiceDataToCheck, res chan<- ServiceCheckResult, ...)
- func SetProtocolURL(rawURL, protocol string) (string, error)
- func StatusCodeUserExistsFunc(data UserServiceDataToCheck) (bool, error)
- type AccountInfo
- func AsciinemaInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func ChessComInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func EmptyInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func GitHubInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func InstagramInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func SnapchatInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func TikTokInfo(data UserServiceDataToCheck) (AccountInfo, error)
- func YouTubeInfo(data UserServiceDataToCheck) (AccountInfo, error)
- type Accounts
- type Bio
- type DataToCheck
- type Errors
- type Image
- type InfoFunc
- type InputData
- type MapServiceCheckResult
- type Player
- type Service
- type ServiceCheckResult
- type ServiceCheckResults
- func (results ServiceCheckResults) GetExisting() Services
- func (results ServiceCheckResults) GetExistingAndFailed() Services
- func (results ServiceCheckResults) GetFailed() Services
- func (results ServiceCheckResults) String() string
- func (results ServiceCheckResults) ToMap() MapServiceCheckResult
- func (results ServiceCheckResults) ToMapExisting() MapServiceCheckResult
- type Services
- type Template
- type TestData
- type User
- type UserExistsFunc
- type UserServiceDataToCheck
- func (data UserServiceDataToCheck) GetImage() (Image, error)
- func (data UserServiceDataToCheck) GetImagelUrl() (string, error)
- func (data UserServiceDataToCheck) GetTemplate(templateString string) (string, error)
- func (data UserServiceDataToCheck) GetUserHtmlUrl() (string, error)
- func (data UserServiceDataToCheck) PatternUrlMatchUserExists(patternTemplate string) (bool, error)
- func (data UserServiceDataToCheck) StatusCodeUserExistsFunc() (bool, error)
- func (data UserServiceDataToCheck) UserExistsFunction() ServiceCheckResult
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultServices = Services{ { Name: "Instagram", UserExistsFunc: func(data UserServiceDataToCheck) (bool, error) { return data.PatternUrlMatchUserExists("user?username={{.Username}}") }, InfoFunc: InstagramInfo, Domain: "www.instagram.com", UserHtmlUrlTemplate: "{{.Domain}}/{{.Username}}/", TestData: TestData{ ExistingUser: "greg", NotExistingUser: "greg2q1412fdwkdfns", }, }, { Name: "GitHub", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: GitHubInfo, Domain: "github.com", UserHtmlUrlTemplate: "{{.Domain}}/{{.Username}}", TestData: TestData{ ExistingUser: "greg", NotExistingUser: "greg2q1412fdwkdfns", }, }, { Name: "YouTube", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: YouTubeInfo, Domain: "youtube.com", UserHtmlUrlTemplate: "{{.Domain}}/@{{.Username}}", UrlTemplates: map[string]string{ "bio": "{{.Domain}}/@{{.Username}}/about", }, TestData: TestData{ ExistingUser: "mrbeast", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "TikTok", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: TikTokInfo, Domain: "tiktok.com", UserHtmlUrlTemplate: "{{.Domain}}/@{{.Username}}", TestData: TestData{ ExistingUser: "greg", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "Npm", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: EmptyInfo, Domain: "npmjs.com", UserHtmlUrlTemplate: "{{.Domain}}/~{{.Username}}", TestData: TestData{ ExistingUser: "greg", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "chess.com", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: ChessComInfo, Domain: "api.chess.com", UserHtmlUrlTemplate: "{{.Domain}}/pub/player/{{.Username}}", BlocksTor: true, TestData: TestData{ ExistingUser: "danielnaroditsky", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "Asciinema", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: AsciinemaInfo, Domain: "asciinema.org", UserHtmlUrlTemplate: "{{.Domain}}/~{{.Username}}", TestData: TestData{ ExistingUser: "greg", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "Lichess", UserExistsFunc: StatusCodeUserExistsFunc, Domain: "lichess.org", UserHtmlUrlTemplate: "{{.Domain}}/api/user/{{.Username}}", BlocksTor: true, TestData: TestData{ ExistingUser: "starwars", NotExistingUser: "gregdoesnotexsist", }, }, { Name: "Snapchat", UserExistsFunc: StatusCodeUserExistsFunc, InfoFunc: SnapchatInfo, Domain: "snapchat.com", UserHtmlUrlTemplate: "{{.Domain}}/add/{{.Username}}", BlocksTor: true, TestData: TestData{ ExistingUser: "greg", NotExistingUser: "gregdoesnotexsistdsada", }, }, }
Functions ¶
func RemoveExtension ¶
func ServicesCheckWorker ¶
func ServicesCheckWorker(s <-chan UserServiceDataToCheck, res chan<- ServiceCheckResult, wg *sync.WaitGroup)
func SetProtocolURL ¶
func StatusCodeUserExistsFunc ¶
func StatusCodeUserExistsFunc(data UserServiceDataToCheck) (bool, error)
Types ¶
type AccountInfo ¶
type AccountInfo struct { Url string `json:"url"` ProfilePicture history.History[Image] `json:"profile_picture" ts_type:"{ latest: { data: string } } "` Bio history.History[Bio] `json:"bio" ts_type:"{ latest: { data: {bio: string} } }"` }
func AsciinemaInfo ¶
func AsciinemaInfo(data UserServiceDataToCheck) (AccountInfo, error)
func ChessComInfo ¶
func ChessComInfo(data UserServiceDataToCheck) (AccountInfo, error)
func EmptyInfo ¶
func EmptyInfo(data UserServiceDataToCheck) (AccountInfo, error)
func GitHubInfo ¶
func GitHubInfo(data UserServiceDataToCheck) (AccountInfo, error)
func InstagramInfo ¶
func InstagramInfo(data UserServiceDataToCheck) (AccountInfo, error)
func SnapchatInfo ¶
func SnapchatInfo(data UserServiceDataToCheck) (AccountInfo, error)
func TikTokInfo ¶
func TikTokInfo(data UserServiceDataToCheck) (AccountInfo, error)
func YouTubeInfo ¶
func YouTubeInfo(data UserServiceDataToCheck) (AccountInfo, error)
func (*AccountInfo) GetProfilePicture ¶
func (info *AccountInfo) GetProfilePicture(url string) error
type Accounts ¶
type Accounts struct { Existing MapServiceCheckResult `json:"existing"` Failed MapServiceCheckResult `json:"failed"` }
type DataToCheck ¶
type DataToCheck []UserServiceDataToCheck
func (DataToCheck) Scan ¶
func (services DataToCheck) Scan(workers int) ServiceCheckResults
type InfoFunc ¶
type InfoFunc func(UserServiceDataToCheck) (AccountInfo, error)
type MapServiceCheckResult ¶
type MapServiceCheckResult map[string]ServiceCheckResult
func (MapServiceCheckResult) Scan ¶
func (results MapServiceCheckResult) Scan(defaultServices Services, workers int) MapServiceCheckResult
basically scanning for the services
type Player ¶
type Player struct { Avatar string `json:"avatar"` PlayerID int `json:"player_id"` ID string `json:"@id"` Url string `json:"url"` Name string `json:"name"` Username string `json:"username"` Followers int `json:"followers"` Country string `json:"country"` Location string `json:"location"` LastOnline int64 `json:"last_online"` Joined int64 `json:"joined"` Status string `json:"status"` IsStreamer bool `json:"is_streamer"` Verified bool `json:"verified"` }
type Service ¶
type Service struct { Name string `json:"name"` UserExistsFunc UserExistsFunc `json:"-"` InfoFunc InfoFunc `json:"-"` UserHtmlUrlTemplate string `json:"-"` UrlTemplates map[string]string `json:"-"` Domain string `json:"domain"` Protocol string `json:"-"` TestData TestData `json:"-"` BlocksTor bool `json:"-"` }
func (Service) TestUserServiceData ¶
func (service Service) TestUserServiceData() UserServiceDataToCheck
func (Service) TestUserServiceData2 ¶
func (service Service) TestUserServiceData2() UserServiceDataToCheck
type ServiceCheckResult ¶
type ServiceCheckResult struct { InputData InputData `json:"input_data"` Exists bool `json:"exists"` Info AccountInfo `json:"info"` Errors Errors `json:"errors"` }
func (*ServiceCheckResult) GetInfo ¶
func (result *ServiceCheckResult) GetInfo(data UserServiceDataToCheck)
func (ServiceCheckResult) GetMapName ¶
func (result ServiceCheckResult) GetMapName() string
func (*ServiceCheckResult) Merge ¶
func (s1 *ServiceCheckResult) Merge(s2 ServiceCheckResult)
func (ServiceCheckResult) String ¶
func (result ServiceCheckResult) String() string
type ServiceCheckResults ¶
type ServiceCheckResults []ServiceCheckResult
func (ServiceCheckResults) GetExisting ¶
func (results ServiceCheckResults) GetExisting() Services
func (ServiceCheckResults) GetExistingAndFailed ¶
func (results ServiceCheckResults) GetExistingAndFailed() Services
func (ServiceCheckResults) GetFailed ¶
func (results ServiceCheckResults) GetFailed() Services
func (ServiceCheckResults) String ¶
func (results ServiceCheckResults) String() string
func (ServiceCheckResults) ToMap ¶
func (results ServiceCheckResults) ToMap() MapServiceCheckResult
func (ServiceCheckResults) ToMapExisting ¶
func (results ServiceCheckResults) ToMapExisting() MapServiceCheckResult
type User ¶
type User struct {
Username string
}
func (User) GetServices ¶
func (user User) GetServices() DataToCheck
func (User) GetServices2 ¶
func (user User) GetServices2(defaultServices Services) DataToCheck
func (User) Scan ¶
func (user User) Scan(workers int) ServiceCheckResults
type UserExistsFunc ¶
type UserExistsFunc func(UserServiceDataToCheck) (bool, error)
type UserServiceDataToCheck ¶
func (UserServiceDataToCheck) GetImage ¶
func (data UserServiceDataToCheck) GetImage() (Image, error)
func (UserServiceDataToCheck) GetImagelUrl ¶
func (data UserServiceDataToCheck) GetImagelUrl() (string, error)
func (UserServiceDataToCheck) GetTemplate ¶
func (data UserServiceDataToCheck) GetTemplate(templateString string) (string, error)
func (UserServiceDataToCheck) GetUserHtmlUrl ¶
func (data UserServiceDataToCheck) GetUserHtmlUrl() (string, error)
func (UserServiceDataToCheck) PatternUrlMatchUserExists ¶
func (data UserServiceDataToCheck) PatternUrlMatchUserExists(patternTemplate string) (bool, error)
func (UserServiceDataToCheck) StatusCodeUserExistsFunc ¶
func (data UserServiceDataToCheck) StatusCodeUserExistsFunc() (bool, error)
func (UserServiceDataToCheck) UserExistsFunction ¶
func (data UserServiceDataToCheck) UserExistsFunction() ServiceCheckResult
Click to show internal directories.
Click to hide internal directories.