One more question re ofxTwitter and .json file


#1

Apologies, @bakercp ; I have your example compiled and running, I followed the correct procedure for creating Consumer Key (API Key), Consumer Key (API Key), Access Token and Access Token Secret, using these values, replacing them in the credentials.json in /bin/data directory. I am still getting
[ error ] ofApp::onException: Exception: std::exception
[ error ] Response::json: Error parsing json: parse error - unexpected end of input
[ error ] BaseSearchClient::_run: No message received
[ error ] ofApp::onException: Exception: std::exception
[ error ] Response::json: Error parsing json: parse error - unexpected end of input
[ error ] BaseSearchClient::_run: No message received
[ error ] ofApp::onException: Exception: std::exception
in debug… I have checked the credentials.json file (for mis-pasting) etc.

Again, I am not sure what else I can check; I am using the example : example_basic_rest_research.

Many thanks, I hope someone can help out on this!

Best,

James

(e.g. some of this is blanked out…)

{
“consumerKey”: “hiddenmktrGDXU96ZjF3”,
“consumerSecret”: “hiddenazklRKzeEqFz6RPmR4ouM2ZTYneNlnYKVdCxUN7q7”,
“accessToken”: “hidden-e1gEsD4l1DJq92cKNpHksETLJrNWnoayaWxiqSNSW”,
“accessTokenSecret”: “hiddenrR5FDGkoMRrMCzSGAITG2rOLH1F53FbuS1Tn”
}


#2

I have the exact same message on my system, and I am using a json file that worked with a simple node.js / javascript bot. I will try and research that some more tomorrow, but of course if someone knows a straightforward answer, that would be welcome!


#3

One update on this topic (trying to make example_basic_rest_search from here): after checking again the json file (which, as I mentioned, works for me with a simple bot with node.js & javascript), trying to download another .pem certificate from the website recommended on the ofxHTTP page, and going step by step into the QtCreator debugger, I could at least get a different error from the aforementioned Error parsing json, which was:

can't find linker symbol for virtual table for `ofEvent<ofx::Twitter::Status const, std::recursive_mutex>::FunctionId<ofApp, void (ofApp::*)(ofx::Twitter::Status const&)>' value  
can't find linker symbol for virtual table for `of::priv::BaseFunctionId' value

These lines got repeated several times, and don’t show up unless one goes step by step into the debugger. I am not even sure this is a reliable indicator of anything, however, as I’m trying now to get this error to show up again and can’t any more.

Once I even had this:

can't find linker symbol for virtual table for `ofFile' value

I also tried to upgrade from QtCreator 4.4.1 to 4.6.0, but that doesn’t make any difference (and running the example from the command line also yields the same json parsing error). I also tried fiddling with the Json file, adding mistakes voluntarily or putting in wrong key/value pairs, only to see the program reacting as one would expect, by pointing to these errors or unknown keys. It does look like this error has less to do with the file itself than with some other thing that I don’t know of…

I would love to be able to keep searching but I don’t even know in what direction to go at present.

Any help would be welcome, thanks in advance!


#4

Update: the plot thickens.

In my slightly obsessive focus on this [ error ] Response::json: Error parsing json: parse error - unexpected end of input, which occurs for me in the first two examples provided with ofxTwitter, ‘example_basic_rest_search’ and ‘example_basic_rest_search_download_image’, I had neglected to try and run the third one, ‘example_basic_streaming_filter’, which, O awe and wonder!, compiled and ran without issue.

I then went back to the first example and could also eliminate the issue when commenting out the client.search(" "); command, while leaving the rest in place, especially the credentials command (contrary to what I had thought). Further digging into the debugger did not allow me to find what the issue was, unfortunately.

I have since given up on getting it to work on my machine, and moved to a strategy where my bot is controlled by a node.js program and communicates with ofx through OSC, but this solution has far less flavour than a self-contained fully-fledged ofxTwitter bot…


#5

Did anyone find a solution to the above. Im getting the same issues having previously been able to build a simple twitter application without errors (about 4 months ago).

Have double checked the credentials file and everything seems to be ok…?


#6

Short answer is no! In the end I used Processing and OSC to do the Twitter part.


#7

Darn it… might test with an older version of openframeworks and see if that works


#8

So my test with an older version of openframeworks was successful (0.9.8 i think). Problem seems to arise when trying to build with latest master from github (0.10.0)…

I then considered if it was potentially just a newer version of one of the addons used by ofxTwitter that was causing the issue and via a process of elimination it seems to be ofxPoco that results in the error.

I was able to get things up and running with the latest openFrameworks master from github and the latest versions of all the addons aside from ofxPoco. I replaced ofxPoco with the version that comes with openframeworks 0.9.8 and bingo everything works… although that doesnt answer what the issue is within ofxPoco?


#9

The ofxTwitter errors [ error ] Response::json: Error parsing json: parse error - unexpected end of input have been fixed. There was a bug in Poco that was causing problems for ofxHTTP. Get the latest stable or master versions fo the related addons and everything should be working again.


#10

Perfect!! Thanks