如何从休息客户端获取Waze的GPS数据?

nar*_*ero 5 ruby rest-client waze

我正在尝试使用rest-client lib 从Waze应用程序获取我的GPS数据.我基本上试图通过网站https://www.waze.com/伪造登录.登录后(您可以使用JohnDoeSpeedy228:gre @ tStory92)访问https://www.waze.com/editor/后,在查看网络调用后点击"驱动器",即可查看原始JSON数据.

我似乎已成功登录,但在发出请求返回所有驱动器的列表时,它返回以下内容

{"users"=>{"objects"=>[]}, "archives"=>{"totalSessions"=>0, "objects"=>[]}}
Run Code Online (Sandbox Code Playgroud)

它应该返回这样的东西:

{
   "users":{
      "objects":[

      ]
   },
   "archives":{
      "totalSessions":1,
      "objects":[
         {
            "id":<REDACTED>,
            "userID":<REDACTED>,
            "existingRoadMeters":2839,
            "newRoadMeters":0,
            "totalRoadMeters":2839,
            "startTime":1456996197000,
            "endTime":1456996636000,
            "hasFullSession":true
         }
      ]
   }
}
Run Code Online (Sandbox Code Playgroud)

这是我正在尝试的:

require 'rest-client'
require 'json'

GET_CSRF_URL = "https://www.waze.com/login/get"
SESSION_URL = "https://www.waze.com/login/create"
SESSION_LIST_URL = "https://www.waze.com/Descartes-live/app/Archive/List"
SESSON_DATA_URL = "https://www.waze.com/Descartes-live/app/Archive/Session"
AUTH = {'user_id'=>'JohnDoeSpeedy228','password'=>'gre@tStory92'}

req = RestClient.get(GET_CSRF_URL)
csrfhash = req.cookies
csrfhash['editor_env'] = 'row'
headers = {'X-CSRF-Token'=>csrfhash['_csrf_token']}

log = RestClient::Request.execute(
  method: :post,
  url: SESSION_URL,
  cookies: csrfhash,
  headers: headers,
  payload: AUTH
)

ses = RestClient::Request.execute(
  method: :get,
  url: SESSION_LIST_URL,
  cookies: log.cookies,
  payload: {'minDistance'=>1000,'count'=>50, 'offset'=>0}
)

puts JSON.parse(ses)
Run Code Online (Sandbox Code Playgroud)

难道我做错了什么?

Ste*_*mes 1

我的猜测是您混淆了两个帐户。您确定您以 JohnDoeSpeedy228 身份登录时登录了驱动器吗?如果手动登录网站时没有来自该用户的会话,我也不希望代码起作用。

我们找不到您的任何驱动器。

您开始使用位智应用程序驾驶了吗?如果是这样,请确保您使用在应用程序中使用的相同凭据登录地图编辑器。