Documentation ¶
Index ¶
- Variables
- func Do[A Action](user *UserRip, action A) bool
- func GetReactionUrl(body io.Reader, reactId string) *url.URL
- func GetReactionsPickerUrl(body io.Reader) *url.URL
- func SearchBasicInfo(body io.Reader) map[string]string
- func SearchParamsForUser(body io.Reader, u *UserRip)
- func SetHeaders(request *http.Request, contentType string, paramsLength int)
- type Action
- type ActionConfig
- type Comment
- type Post
- type Publicate
- type React
- type RipPayload
- type Scrap
- type UserInfo
- type UserRip
- func (u *UserRip) Do(actionConfig ActionConfig)
- func (u *UserRip) GetBasicInfo()
- func (u *UserRip) GetParameterKeys() []string
- func (u *UserRip) GetParametersAsUrlValues() url.Values
- func (u *UserRip) GetRequest(requestUrl *url.URL) *http.Response
- func (u *UserRip) Rip() bool
- func (u *UserRip) Sense() error
- func (u *UserRip) ValidCookies() bool
Constants ¶
This section is empty.
Variables ¶
var BasicFacebookUrl, _ = url.Parse("https://mbasic.facebook.com/")
var FacebookUrl, _ = url.Parse("https://www.facebook.com/")
Functions ¶
func GetReactionUrl ¶
Declaring Url & Converting `reactId` to integer Looking for ActionBar where its patern path is: tbody > tr > td > a
func GetReactionsPickerUrl ¶
Looking for ActionBar where its patern path is: tbody > tr > td > a
func SearchBasicInfo ¶
Searching path: 1*<div id="basic-info"> -> 6*<a> (<a> contains href which helps to determine what type of info attribute we are dealing)
func SearchParamsForUser ¶
Finding user's parameters that are in input tags
Types ¶
type ActionConfig ¶
type Comment ¶
func NewComment ¶
type React ¶
func NewReaction ¶
type RipPayload ¶
type RipPayload struct { User jsonUser `json:"user"` Actions jsonActions `json:"actions"` }
func ReadRip ¶
func ReadRip(path string) (*RipPayload, error)
type Scrap ¶
type UserRip ¶
type UserRip struct { Email string Password string Parameters map[string]string Client *http.Client Info UserInfo }
func NewUserRip ¶
func (*UserRip) Do ¶
func (u *UserRip) Do(actionConfig ActionConfig)
func (*UserRip) GetBasicInfo ¶
func (u *UserRip) GetBasicInfo()
func (*UserRip) GetParameterKeys ¶
func (*UserRip) GetParametersAsUrlValues ¶
func (*UserRip) Rip ¶
Login workflow; Setting policy for handling redirects by returning `http.ErrUseLastResponse` to avoid making next request automatically since is no needed for login. Cookies Gathered (minus sense() cookies):
- sb (e.g. 'mT-kYiYOVgO1REEuVoN3QIkt')
- c_user (e.g. 100008137277101)
- xs (e.g. '3%3AgAfz50LpTd4C6A%3A2%3A1654931354%3A-1%3A2298')
- fr (e.g. '0z1tHKUHfVz6RQcyW.AWXxkBqxuktzL1QQzfdJ4Z_ZeQ4.BipD-a.pb.AAA.0.0.BipD-a.AWUAUnp-IxI')
func (*UserRip) Sense ¶
Getting first set of cookies and parameters needed for make a login request Cookies Gathered:
- datr (e.g. 'vhmkYoqy7RdEbjo_7-CfCB1A')
Parameters Gathered:
- jazoest (e.g. 2879)
- li (e.g 'vhmkYn8H32beqTnQp3ZeUcq3')
- login (e.g 'Log in')
- lsd (e.g 'AVqG3uZN6UE')
- m_ts (e.g 1654921662)
- try_number (e.g 0)
- unrecognized_tries (e.g 0)
func (*UserRip) ValidCookies ¶
Validates if the user has the necessary cookies to login. Coockies = "datr", "sb", "c_user", "xs", "fr"