Twitter4j and Processing2

Hi,

Has anyone used the twitter4j library with Processing2?

I've noticed the twitter4j library includes an object type called JSONObject. Processing2 also has an object type called JSONObject, which is something I need to use elsewhere in my code, however attempting to do so with the twitter4j libraries loaded gives me the error "The type JSONObject is ambiguous".

Does anyone know of a way around this? Is there a way of referencing the object specifically from the core processing library when I'm declaring my object in order to avoid the ambiguity?

Many thanks, Rag

Answers

  • Hi ragnarula,

    Your error message is ambiguous! ha ha ha, that error cracks me up.

    its a pain, but everytime you mention JSONObject, you'll need to prefix it with the specific class that you want to use. For example:

    processing.data.JSONObject whatAPain = new processing.data.JSONObject();

    substitue 'processing.data.' for a different json library if you like the twitter4j version or another one entirely.

    Hope this helps! ak

  • I think you can also call twitter4j.json.JSONObjectType

Sign In or Register to comment.