Twitter Trend Topics using API1.1


#1

I would like some help if possible. I’m trying to show the results of the twitter trends topics using their new API1.1

Here is my code

foreach ($content as $topics) {
    echo $topics->trends['name'];
}

And here the result of the query

Array(
[0] => stdClass Object
    (
        [trends] => Array
            (
                [0] => stdClass Object
                    (
                        [name] => #FinalNoel
                        [url] => http://twitter.com/search?q=%23FinalNoel
                        [promoted_content] => 
                        [query] => %23FinalNoel
                        [events] => 
                    )

                [1] => stdClass Object
                    (
                        [name] => #WeOwnTheNightin3Days
                        [url] => http://twitter.com/search?q=%23WeOwnTheNightin3Days
                        [promoted_content] => 
                        [query] => %23WeOwnTheNightin3Days
                        [events] => 
                    )

Thanks for helping.


#2

Is the issue you’re having going to the next step to retrieve tweets that match a trending topic?

You’ll want to take the “query” component of each trend response and use them as the “q” parameter in requests to the [node:10287] API.

What library are you using to retrieve the trends results?