Jump to content

Recommended Posts

Posted (edited)

hey I'm currently unable to fetch my cursor from dropbox if anyone can help me that would be awesome. 

Func HttpGet($url, $data)
Local $get = ObjCreate("WinHttp.WinHttpRequest.5.1")
if _FindNetwork() = "xavier" Then   $get.SetProxy(2, "proxy.school:number")
$get.SetTimeouts(30000,60000,30000,400000) ;give 6 minutes for timeout on requests
$get.Open("GET", $url & "?" & $data, False)
If @error Then
   Return SetError(1, 0, $get.ResponseText)
endif

$get.Send()

If @error  Then
   Return SetError(2, 0, $get.ResponseText)
endif


If $get.Status <> $HTTP_STATUS_OK Then
   Return SetError(3, 0, $get.ResponseText)
endif

Return SetError(0, 0, $get.ResponseText)
EndFunc

Func HttpGetLongDelta($Cursor)
message("Waiting for change notification")

local $time=currenttime()
local $Random = Random(0,32767,1)
local $url = 'https://api-notify.dropbox.com/1/longpoll_delta'

local $Response  = HttpGet($url,'cursor='&$Cursor) ;wait for 6 minutes
if @error then
    Return SetError(@error, 0, $Response)
EndIf

message("message: "&$Response)


return SetError(0, 0, $Response)


EndFunc
Edited by Gimerly

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...