Twitter Streaming API + ofxOAuth


#1

Hi All,

I’m working on a project where I’m trying to get tweets from “Streaming API” using @bakercp’s ofxOAuth.
I looked at ofxExampleTwitterClient.h file and modified it a little to use stream API but No luck so far.

void setup(const std::string& consumerKey, const std::string& consumerSecret)
    {
       ofxOAuth::setup("https://stream.twitter.com",
                        consumerKey,
                        consumerSecret);
    }
std::string exampleMethod()
    {
        return get("/1.1/statuses/filter.json?track=chicago");
    }

it seemed working but it never returned results.
this is an infinite log while the App is running:

[verbose] WriteMemoryCallback: IN MEMORY CALLBACK
ptr: 0x283eae4
size: 1
nmemb: 158
data: 0xbfffd670
----
ptr: 0x283eae4
size: 1
nmemb: 158
data: 0xbfffd670
realsize: 158
.......
......

my guess is that the app waits to return the result until it finishes requesting but with stream API, it keeps requesting the query so the app holds the data in memory. I wonder how can I get these data as the app receives it.
I appreciate if anyone can help me to figure out this, or any suggestion of other resources
Thanks,
Gill