[cl-facebook-devel] Fwd: JSON error on response

Matt Novenstern mnovenstern at students.colgate.edu
Fri Jan 15 08:14:30 UTC 2010


On Mon, 2010-01-04 at 11:16 +0000, Dean Swinfield wrote:
> 
> 
> Hello,
> Firstly, I should point out that I'm a Lisp newbie, so I could be
> doing something silly, but when I try the example for cl-facebook, I
> get an error, and could do with some guidance..
> 
> This is what I type it (I'm using SBCL via emacs and SLIME):
> 
> 
> CL-USER> (setq *secret* "bec63f898bd92e1ee185ef6335dbbb10")
> CL-USER> (setq *api-key* "cc5ec811854818562c9a0362b13657d9")
> CL-USER> (setq *auth-id* (cl-facebook:facebook-auth-id *api-key*
> *secret*))
> 
> 
> (obviously, the key and secret values are pseudo, but I'm showing how
> they were entered)
> 
> 
> After hitting return on the third line, I get this debug trace..
> 
> 
> Invalid JSON literal name: Not [in #<SB-SYS:FD-STREAM for "a
> socket" {B18E169}>]
>    [Condition of type JSON:JSON-SYNTAX-ERROR]
> 
> 
> Restarts:
>  0: [ABORT] Return to SLIME's top level.
>  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread"
> RUNNING {B81AF49}>)
> 
> 
> Backtrace:
>   0: (JSON:JSON-SYNTAX-ERROR #<SB-SYS:FD-STREAM for "a
> socket" {B18E169}> "Invalid JSON literal name: ~A")[:EXTEND]
>   1: (JSON:DECODE-JSON #<SB-SYS:FD-STREAM for "a socket" {B18E169}>)
>   2: ((LAMBDA ()))
>   3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SETQ *AUTH-ID*
> (CL-FACEBOOK:FACEBOOK-AUTH-ID *API-KEY* *SECRET*)) #<NULL-LEX$
>  --more--
> 
> 
> The rest of the trace is the usual SLIME stuff. Anyway, anyone have
> thoughts on what I'm doing wrong? Or suggest some routes for
> exploration? 
> 
>  PS.
> Can i just point out that I've had issues trying to post to this mail
> group, as I suspect it treats gmail.com and googlemail.com as separate
> domains (whereas gmail doesn't).
> 
> Thanks
> 
> 
> Dean.

I went to look at the code and see if I got your problem, and it seems
it's been a while since I used cl-facebook, and cl-trivial-https seems a
bit hard to come by.  I started porting it to drakma to be a bit more
current, and I haven't finished that yet, so I haven't had a chance to
reproduce your problem.

I'm also a lisp newbie, but, I'd try and get at that stream it's talking
about and see what's in it.  cl-facebook is set up to read
JSON-formatted output from the facebook REST api, which sends the more
complicated XML by default.  If it's JSON, it should be something like
this:

{ [ "status" : "ok" ], ["property" : "value" ] }

while XML looks more like this:

<xml>
 <property>value</property>
</xml>

In any event, try and make sure you're getting JSON data back from the
server.  I will try and hack my system back into working order soon.

-Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cl-facebook-devel/attachments/20100115/b8b00d4b/attachment.sig>


More information about the cl-facebook-devel mailing list