Commits

chrishoffman  committed d96de58

Adding api proxy service

  • Participants
  • Parent commits a786b8d
  • Branches apiproxy

Comments (0)

Files changed (1)

File source/picasa.brs

     ' constructor
     this = CreateObject("roAssociativeArray")
     this.protocol = "http"
-    this.scope = this.protocol + "://picasaweb.google.com/data"
+    this.proxy_api_url = getProxyAPI()
+    this.api_base = "picasaweb.google.com/data"
+    this.scope = this.protocol + "://" + this.api_base
     this.prefix = this.scope + "/feed/api"
     this.oauth_prefix = "https://www.google.com/accounts"
     this.link_prefix = getLinkWebsite()
     
     http = NewHttp(m.prefix + "/" + username + url_stub)
     oa.sign(http,true)
+    http.callbackPrep = ProxyApiCallback
     
     xml=http.getToStringWithTimeout(10)
     print xml
     return rsp
 End Function
 
+'Override default oauth callback
+Function ProxyApiCallback()
+    picasa = LoadPicasa()
+    Oauth().prep(m) 'Sign request
+    m.base = strReplace(m.base, picasa.api_base, picasa.proxy_api_url) 
+End Function
+
 ' ********************************************************************
 ' ********************************************************************
 ' ***** Picasa