I manage with:

$CONSUMER_KEY = $this->config->item('CONSUMER_KEY');
$CONSUMER_SECRET = $this->config->item('CONSUMER_SECRET');

$connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET);

$response = json_decode($connection->http('http://api.twitter.com/1/
statuses/public_timeline.json', 'GET'));

The $response object have the 20 most recent tweets.

Thanks

On Jun 23, 11:39 am, luisg <[email protected]> wrote:
> Hello all,
>
> I'm testing Abraham twitter library and works really nice.
>
> But I have a doubt for more simple stuff... Imagine that I want to do
> a call to twitter without authenticate first. For example, to get the
> last 20 public tweets I dont need to authenticate first, right? So,
> you have any example how to do it?
>
> I looked at the http method in twitteroauth class and I tried
> something like:
>
> $content = json_decode($connection->http('https://api.twitter.com/1/
> statuses/public_timeline.json', 'GET'));
>
> but my doubt is how can I create the $connection object? I tried
> something like:
>
> $connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET);
>
> But didn't work.
> Can you help me?
>
> P.S.: sorry for the stupid question...

Reply via email to