Add authentication
Breaking changes: removed WithCookie and WithXCsrfToken
This commit is contained in:
parent
3d364abaac
commit
eb18988829
7 changed files with 236 additions and 33 deletions
19
README.md
19
README.md
|
|
@ -168,14 +168,25 @@ func main() {
|
|||
}
|
||||
```
|
||||
|
||||
### Use cookie authentication
|
||||
### Use authentication
|
||||
|
||||
Some specified user tweets are protected that you must login and follow.
|
||||
Cookie and xCsrfToken is optional.
|
||||
It is also required to search.
|
||||
|
||||
```golang
|
||||
scraper.WithCookie("twitter cookie after login")
|
||||
scraper.WithXCsrfToken("twitter X-Csrf-Token after login")
|
||||
err := scraper.Login("username", "password")
|
||||
```
|
||||
|
||||
Status of login can be checked with:
|
||||
|
||||
```golang
|
||||
scraper.IsLoggedIn()
|
||||
```
|
||||
|
||||
Logout (clear session):
|
||||
|
||||
```golang
|
||||
scraper.Logout()
|
||||
```
|
||||
|
||||
### Use Proxy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue