Error: Malformed response from server, was not JSON


#1

Hi,

I am using R with the twitteR package to search Twitter for specific hash-tags. I am doing:
list = searchTwitter("#somerandomhashtag", n=1000, lang=‘en’, since=‘YYYY-MM-DD’, until=‘YYYY-MM-DD’, geocode=‘00.000,-00.000,50mi’)
(Of course, all information is plugged in correctly.)

The error I am getting is:
Error in .self$twFromJSON(out) :
Error: Malformed response from server, was not JSON

I do have the rjson and RJSONIO packages loaded as well. I read somewhere that there may be dependencies on the sequence that the three packages are loaded, but I have tried all combinations of orderings.

The code was working a few days ago. Could anyone point me in the right direction at what may be causing this.

Thank you.


#2

I am having the same issue today with twitteR. Have you been able to get any information on the source of this error or how to resolve it?


#3

i have the same problem, but i think it is related to non-Latin tweets… is there anyway to ignore non-Latin tweets?


#4

I’m having the same problem too.

Error in .self$twFromJSON(out) :
Error: Malformed response from server, was not JSON
In addition: Warning message:
In strsplit(msg, “\n”) : input string 1 is invalid in this locale

R on Ubuntu 12.10


#5

ah okay… I have an apparent fix.

install the RJSONIO package and make sure you have it loaded

install.packages(“RJSONIO”)
library(RJSONIO)


#6

@rmounce, It worked once by using your suggestion. But later on, it does not work anymore.


#7

I am still facing the same problem.
Error in .self$twFromJSON(out) :
Error: Malformed response from server, was not JSON

It was working earlier and now its stopped working.

I tried everything, did your issue get resolved.


#8

Not solved at all. I think it has something to do with the server’s limitation on the API. IF we retrieve too much info, we are likely to run into this kind of annoying error. Sigh… :frowning:


#9

Hi

You can try re writing the syntax as
searchTwitter(‘hashtag’,since=“YYYY-MM-DD”,until =“YYYY-MM-DD”,cainfo=“cacert.pem”)

Removing “n=1000” from the arguments worked for me