Documentation ¶
Index ¶
- Variables
- func GetCookie(url string) (cj *cookiejar.Jar, err error)
- func GetRequest(url string, header map[string]string) (string, error)
- func GetRequestByCookie(url string, cj *cookiejar.Jar) (string, error)
- func Parse(resp string, rudder *Rudder) (pageNo int, pageCount int, users map[string][]string, err error)
- func ParseJson(resp string, out *map[string]interface{}) (err error)
- func ValueToString(in *map[string]interface{}) (out *map[string]string, err error)
- type Rudder
- type Seed
- type SharedCookie
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHeader = map[string]string{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/47.0.2526.73 Chrome/47.0.2526.73 Safari/537.36",
}
Functions ¶
Types ¶
type Rudder ¶
type Rudder struct { //pattern to get number of related users CountPatterns []string //pattern to get current page number PageNoPatterns []string //pattern to get page size //PageSizePattern string //pattern to get number of pages PageCountPatterns []string //pattern to get user id IDsPatterns []string //pattern to get user name NamesPatterns []string //pattern to get followers count FollowersCountPatterns []string //other patterns to get user info OtherPatterns []string OtherListPatterns []string }
since regexp does not support lookbehind/ahead, use multi patterns instead
type Seed ¶
type SharedCookie ¶
type SharedCookie struct {
// contains filtered or unexported fields
}
func NewSharedCookie ¶
func NewSharedCookie(url string) (sck *SharedCookie)
func (*SharedCookie) GetCookieUrl ¶
func (ck *SharedCookie) GetCookieUrl() (url string, err error)
func (*SharedCookie) GetSharedCookie ¶
func (ck *SharedCookie) GetSharedCookie() (cj *cookiejar.Jar, err error)
func (*SharedCookie) UpdateSharedCookie ¶
func (ck *SharedCookie) UpdateSharedCookie() (cj *cookiejar.Jar, err error)
Click to show internal directories.
Click to hide internal directories.