feat: x.com migration + public API for cookie-based auth
- migrate all API URLs from twitter.com to x.com - add SetBearerToken, SetHTTPClient, SetLoggedIn public methods - accept 202/204 status codes in handleResponse - module path -> src.cultist.club/lain/twitter-scrapper
This commit is contained in:
parent
76cb95cd3e
commit
34db837a9e
19 changed files with 75 additions and 63 deletions
|
|
@ -65,7 +65,7 @@ type user struct {
|
|||
// GetProfile return parsed user profile.
|
||||
func (s *Scraper) GetProfile(username string) (Profile, error) {
|
||||
var jsn user
|
||||
req, err := http.NewRequest("GET", "https://api.twitter.com/graphql/Yka-W8dz7RaEuQNkroPkYw/UserByScreenName", nil)
|
||||
req, err := http.NewRequest("GET", "https://api.x.com/graphql/Yka-W8dz7RaEuQNkroPkYw/UserByScreenName", nil)
|
||||
if err != nil {
|
||||
return Profile{}, err
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ func (s *Scraper) GetProfile(username string) (Profile, error) {
|
|||
|
||||
func (s *Scraper) GetProfileByID(userID string) (Profile, error) {
|
||||
var jsn user
|
||||
req, err := http.NewRequest("GET", "https://twitter.com/i/api/graphql/Qw77dDjp9xCpUY-AXwt-yQ/UserByRestId", nil)
|
||||
req, err := http.NewRequest("GET", "https://x.com/i/api/graphql/Qw77dDjp9xCpUY-AXwt-yQ/UserByRestId", nil)
|
||||
if err != nil {
|
||||
return Profile{}, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue