GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - parasyte-x/reX: Reverse Engineered Twitter's API

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
x
x
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
example.go
example.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
twitter.png
twitter.png
 
 

Repository files navigation

reX

go report card MIT license

Since twitter dev removed the API for accessing user followers and following, developers have found it difficult to obtain this data. Here, I'm sharing my reverse engineering solution. If it's helpful to you, please let me know.

Installation

go get -u github.com/amovane/reX

Login

uname := os.Getenv("USER_NAME")
upwd := os.Getenv("PASSWORD")
x := reX.New()
wd, _ := os.Getwd()
cookiesPath := fmt.Sprintf("%s/cookies.json", wd)
err := x.SetCookies(cookiesPath)
if err != nil || !x.IsLoggedIn() {
    println("You must login first")
    x.Login(uname, upwd)
    x.SaveCookies(cookiesPath)
}

Followings

var cursor *string
var tweets []reX.UserResults
for {
    tweets, cursor, err = x.GetFollowingsByScreenName("shareverse_", cursor)
    for _, tweet := range tweets {
        println(tweet.Result.Legacy.ScreenName)
    }
    if cursor == nil || err != nil {
        break
    }
}

Followers

var cursor *string
var tweets []reX.UserResults
for {
    tweets, cursor, err = x.GetFollowerssByScreenName("shareverse_", cursor)
    for _, tweet := range tweets {
        println(tweet.Result.Legacy.ScreenName)
    }
    if cursor == nil || err != nil {
        break
    }
}

Is following

uid, _ := x.GetUserIDByScreenName("jarredsumner")
uidOfFollower, _ := x.GetUserIDByScreenName("cybermageek")
isFollowing := x.IsFollowing(uid, uidOfFollower)

About

Reverse Engineered Twitter's API

Topics

reverse-engineeringscrapertwittertwitter-apitwitter-api-v2twitter-scrapertwitterscraper

Resources

Readme
Activity

Stars

79 stars

Watchers

2 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.