Re: [racket-users] Re: using ryanc's oauth2 package with Google?

2016-02-15 Thread Fred Martin
hahah!

I finished my "interacting with Google Drive via Racket" experiment. Basically, 
it recursively collects subfolders, and then lets you issue a search query over 
all of them at once.

If anyone wants to check it out, the code is here: 
https://github.com/fgmart/google-drive-racket.

I removed the "secret" from the commit. Email me if you want to use my Google 
Developer client :)

Thanks everyone for your help!

Fred

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] preserve objects created in REPL after adding/changing proc definitions?

2016-02-15 Thread Fred Martin
Matt Jadud pointed me at 
https://docs.racket-lang.org/reference/serialization.html, which allowed me to 
save my object in my definitions buffer along Neil's suggestion. :)

Greg, I tried un-checking the "enforce constant definitions" box and after 
restarting DrRacket, it now allows me to copy-paste into the REPL to redefine 
stuff.

Thanks all!!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] preserve objects created in REPL after adding/changing proc definitions?

2016-02-15 Thread Fred Martin
Hi Neil, thanks.

In my case presently, "long-computation" is gathering up results from a bunch 
of net queries, and the result is a list of hash objects.

I don't think your suggestion will work for this?

Also the nature of your suggestion is making me nervous that I'm asking for 
something that's really not there?

I remember in MCL that you could re-evaluate a single procedure definition -- 
does Racket have anything like that?

Fred

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] preserve objects created in REPL after adding/changing proc definitions?

2016-02-15 Thread Fred Martin
This may be a silly question. 

Suppose I do something in the REPL that takes a while to compute:

(define important-object (long-computation))

and now I want to write new procedures (or modify existing ones) that will work 
with important-object.

Is there any way to do this?

If I change code in the definitions window and hit Run, important-object goes 
away.

Thanks :)

Fred

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] using ryanc's oauth2 package with Google?

2016-02-14 Thread Fred Martin
Hi all,

I am trying to get oauth working with Google so I can write some Google Drive 
code in Racket.

I set up an "installed application" in a project in my Google dev console, and 
copied its ID to my Racket code.

When I try to get a token, it seems like everything is working -- I log into my 
Google account, select my app and grant it permission, and the browser redirect 
thinks that it succeeded in sending the auth code back to Racket.

But then I get the error oauth2:acquire-token/auth-code/json: failed: "HTTP/1.1 
400 Bad Request". 

Has anyone used this package lately? Below is the whole code for what I'm doing.

Thanks!

Fred



#lang racket

(require (planet ryanc/webapi:1:=1/oauth2))

(define myclient
  (oauth2-client
   #:id 
"548798434144-mhbmkbnlbi834tag326e5eojhgho9uco.apps.googleusercontent.com"
   #:secret #f))

; goes through the whole browser login and grant privs, and even seems
; to send the auth code back to localhost, 
; then fails with: 'oauth2:acquire-token/auth-code/json: failed: "HTTP/1.1 400 
Bad Request"'
(oauth2/request-auth-code/browser
 google-auth-server
 myclient
 '("https://www.googleapis.com/auth/drive;))

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: using ryanc's oauth2 package with Google?

2016-02-14 Thread Fred Martin
So... even though I chose "Other" as the client type, my API credentials were 
created with a secret.

I had to copy the secret into my client constructor request.

>From my reading of the oauth 2 API docs, I thought "installed app" clients 
>weren't supposed to have secrets?

Anyway at this point, I have a validated oauth2 object, with its access token :)

Fred

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.