Documentation ¶
Index ¶
- func AddUsersToFetchFromDatabase(db *gorm.DB)
- func ExtractAnimeStats(elem *goquery.Selection) *core.AnimeStats
- func ExtractBasicInfo(elem *goquery.Selection) *core.BasicInfo
- func ExtractFriendNames(elem *goquery.Selection) []string
- func ExtractMangaStats(elem *goquery.Selection) *core.MangaStats
- func GetOrCreateUser(username string, db *gorm.DB) *core.User
- func GetUser(username string, db *gorm.DB, finished chan bool, ...)
- func GetUsersToFetchFromCache(limit int) []*core.User
- func PopulateCache(db *gorm.DB)
- type CacheStats
- type Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUsersToFetchFromDatabase ¶
AddUsersToFetchFromDatabase adds to cache all users from database that are not yet fetched
func ExtractAnimeStats ¶
func ExtractAnimeStats(elem *goquery.Selection) *core.AnimeStats
ExtractAnimeStats gets anime stats from single user's profile page
func ExtractBasicInfo ¶
ExtractBasicInfo gets basic info about the user
func ExtractFriendNames ¶
ExtractFriendNames gets friends names from single page
func ExtractMangaStats ¶
func ExtractMangaStats(elem *goquery.Selection) *core.MangaStats
ExtractMangaStats gets manga stats from single user's profile page
func GetOrCreateUser ¶
GetOrCreateUser returns User object - if it's a new user, saves it to database and cache first
func GetUser ¶
func GetUser(username string, db *gorm.DB, finished chan bool, relationsChannel chan []core.Relation)
GetUser obtains stats for single user and their friends
func GetUsersToFetchFromCache ¶
GetUsersToFetchFromCache returns next batch of users to download
func PopulateCache ¶
PopulateCache fetches all users from database into cache
Types ¶
type CacheStats ¶
CacheStats contains information about current scraping process, to be displayed in the command line
func GetStatsFromCache ¶
func GetStatsFromCache() *CacheStats
GetStatsFromCache returns information about current scraping process