Closed residuum closed 9 years ago
I suppose, this is Mac OS X. I have just tested it an my Debian, and though the output of oauth is truncated on Pd console or bash (if started with -stderr), I can connect the outlet to json-encode without problems.
Some thoughts on the error:
This search returns UTF-8 strings, including Asian characters.
Are you building using json-c 0.9? Then there is a crude fix for a unicode problem in the code (https://github.com/residuum/PuRestJson/blob/json-c-0.10/json-decode.c#L75). This code is wrong, because there are characters that are encoded to more than 4 hex characters.
Have you tried a search that only yields results from lower codepages? Something like "college%20football" comes to mind.
If that is the case, then someone needs to fix this crude fix to a correct one, or maybe an upgrade to a later version of json-c is required.
See also issue #5
maybe an upgrade to a later version of json-c is required.
yeah the fink version is the problem. I just installed the latest json-c from github manually and all is fine compiling your lib... only that one change eliminating universal builds was necessary.
m
On Sun, Jan 19, 2014 at 4:00 PM, Thomas Mayer notifications@github.comwrote:
I suppose, this is Mac OS X. I have just tested it an my Debian, and though the output of oauth is truncated on Pd console or bash (if started with -stderr), I can connect the outlet to json-encode without problems.
Some thoughts on the error:
This search returns UTF-8 strings, including Asian characters.
Are you building using json-c 0.9? Then there is a crude fix for a unicode problem in the code ( https://github.com/residuum/PuRestJson/blob/json-c-0.10/json-decode.c#L75). This code is wrong, because there are characters that are encoded to more than 4 hex characters.
Have you tried a search that only yields results from lower codepages? Something like "college%20football" comes to mind.
If that is the case, then someone needs to fix this crude fix to a correct one, or maybe an upgrade to a later version of json-c is required.
This will not work with
— Reply to this email directly or view it on GitHubhttps://github.com/residuum/PuRestJson/issues/32#issuecomment-32719748 .
m.e.grimm | m.f.a | ed.m. megrimm@gmail.com
Hi,
I have the same problem using windows and the last 1.1.0... any fixed release for this?
Here is what I have in my pd console:
raw_data: symbol \{"statuses":[\{"metadata":\{"iso_language_code":"en"\\,"result_type":"recent"\}\\,"created_at":"Tue Sep 23 17:32:04 +0000 2014"\\,"id":514467246308335616\\,"id_str":"514467246308335616"\\,"text":"@CNBC @Water Yeah because when it comes to #ClimateChange we all should look to #MattDamon for advice. Does he know how to fix a leak too?"\\,"source":"\\\\u003ca href=\\\\"http:\\\\/\\\\/twitter.com\\\\" rel=\\\\"nofollow\\\\"\\\\u003eTwitter Web Client\\\\u003c\\\\/a\\\\u003e"\\,"truncated":false\\,"in_reply_to_status_id":514466790332592129\\,"in_reply_to_status_id_str":"514466790332592129"\\,"in_reply_to_user_id":20402945\\,"in_reply_to_user_id_str":"20402945"\\,"in_reply_to_screen_name":"CNBC"\\,"user":\{"id":60201115\\,"id_str":"60201115"\\,"name":"Jason Billings"\\,"screen_name":"SingleDallasGuy"\\,"location":"Dallas\\, TX"\\,"description":"Just a guy in Dallas\\, TX taking each day as it comes. BTW\\, liberals piss me off!"\\,"url":null\\,"entities":\{"description":\{"urls":[]\}\}\\,"
raw_done: bang
decoded_data: list statuses [ \{ "metadata": \{ "iso_language_code": "en"\\, "result_type": "recent" \}\\, "created_at": "Tue Sep 23 17:32:04 +0000 2014"\\, "id": 514467246308335616\\, "id_str": "514467246308335616"\\, "text": "@CNBC @Water Yeah because when it comes to #ClimateChange we all should look to #MattDamon for advice. Does he know how to fix a leak too?"\\, "source": "<a href=\\\\"http:\\\\/\\\\/twitter.com\\\\" rel=\\\\"nofollow\\\\">Twitter Web Client<\\\\/a>"\\, "truncated": false\\, "in_reply_to_status_id": 514466790332592129\\, "in_reply_to_status_id_str": "514466790332592129"\\, "in_reply_to_user_id": 20402945\\, "in_reply_to_user_id_str": "20402945"\\, "in_reply_to_screen_name": "CNBC"\\, "user": \{ "id": 60201115\\, "id_str": "60201115"\\, "name": "Jason Billings"\\, "screen_name": "SingleDallasGuy"\\, "location": "Dallas\\, TX"\\, "description": "Just a guy in Dallas\\, TX taking each day as it comes. BTW\\, liberals piss me off!"\\, "url": null\\, "entities": \{ "description": \{ "urls": [ ]
decoded_data: list search_metadata \{ "completed_in": 0.039000\\, "max_id": 514467246308335616\\, "max_id_str": "514467246308335616"\\, "next_results": "?max_id=514467141685608450&q=%23climatechange&include_entities=1"\\, "query": "%23climatechange"\\, "refresh_url": "?since_id=514467246308335616&q=%23climatechange&include_entities=1"\\, "count": 15\\, "since_id": 0\\, "since_id_str": "0" \}
decoding_done: bang
@mrpropre: The example looks right, Puredata truncates the output, but the decoding of JSON is working correctly, even unicode portions (\u003ca
).
From @megrimm via email:
When example [GET /1.1/users/search.json?q=puredata{ is sent to [oauth] to get data from Twitter API, not all data is returned therefore giving a "Not a JSON object" using [json-decode]. Not sure the issue if its [oauth] or me...
here the pd console output: