I’m at my wit’s end in troubleshooting this and hope that the community can help, regardless of their preferred programming language.
I’m basically doing Twitter user lookups for a set of user ids via the appropriate API get request (users/lookup). However, it seems something happens in parsing the JSON, via RJSONIO’s fromJSON function, that results in it effectively nullifying the ‘url’ of every other user’s JSON tree.
Here’s my code (in R, but should be intuitive to everyone):
url_req_users <- paste0("https://api.twitter.com/1.1/users/lookup.json?user_id=", user_ids) req_users <- GET(url_req_users, add_headers(Authorization = token)) raw_req_users <- content(req_users, as = "text", type = "application/json") rt_users <- fromJSON(raw_req_users)
I then preview the data and get this for one record:
> rt_users[]$url  "https://t.co/JDT0ZEWO8X"
But then I get this for the next record (for every other record, actually):
> rt_users[]$url NULL
Any ideas? For what it’s worth, I’d really prefer to stick with RJSONIO, as I use it in other parts of my application.
Thanks, in advance, for your help!