Dim Const PB As String = "https://api.pushbullet.com/v2/"
' Get information about the current user.
Dim Const PBme As String = PB&"users/me"
[..]
Dim job As HttpJob
job.Initialize("ME",Me)
job.Download(PBme)
job.GetRequest.SetHeader("Authorization", "Bearer "&secret)
Sub JobDone (job As HttpJob)
LogColor("JobDone ("&job.JobName&")",Colors.Blue)
If job.Success = True Then
Select job.JobName
Case "ME"
lv.Clear
Log(job.GetString)
Dim parser As JSONParser
parser.Initialize(job.GetString)
Dim root As Map = parser.NextObject
Dim iden As String = root.Get("iden")
lv.AddTwoLines2(iden,"iden",root)
Dim email As String = root.Get("email")
lv.AddTwoLines2(email,"eMail",root)
Dim name As String = root.Get("name")
lv.AddTwoLines2(name,"Name",root)
Dim created As Double = root.Get("created")
lv.AddTwoLines2(created,"Created",root)
Dim google_userinfo As Map = root.Get("google_userinfo")
Dim name As String = google_userinfo.Get("name")
Dim email_normalized As String = root.Get("email_normalized")
Dim preferences As Map = root.Get("preferences")
Dim onboarding As Map = preferences.Get("onboarding")
Dim extension As String = onboarding.Get("extension")
Dim app As String = onboarding.Get("app")
lv.AddTwoLines2(app,"App",root)
Dim friends As String = onboarding.Get("friends")
lv.AddTwoLines2(friends,"Friends",root)
Dim mac As String = onboarding.Get("mac")
lv.AddTwoLines2(mac,"Mac",root)
Dim modified As Double = root.Get("modified")
lv.AddTwoLines2(modified,"Modified",root)
Dim image_url As String = root.Get("image_url")
[...]