Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter-Twitter Library

After having a bit of a look online, I found that the only CodeIgniter library for Twitter works by looking at RSS feeds (http://www.haughin.com/code/twitter/).

So, CodeIgniter-Twitter was born. It's a library which provides simple access to the Twitter API, allowing you to do things like:

- Post a new tweet
- Access/send direct messages
- Follow new people
- Update a user's profile


Usage is as follows:

$this->twitter->update('My awesome tweet!');

As long as you call the auth() method before anything else in the class, everything should work fine.

You can download the library by visiting the project's page on Github here:

Thanks for sharing, this is really useful.

Thought I'd post an update - after a little bit of testing (2 minutes), it looks like this can be used as a library in Kohana, and as a standard class in PHP. It's not necessarily limited to just CodeIgniter.

Thx for sharing this Simon. I've implemented it, but seem to be running into a problem when I pass params to some of the methods. For example, when passing in a page param to the replies method:
$data['replies'] = $this->twitter->replies('','',2);

It returns me nothing, however when I don't have any params in there:
$data['replies'] = $this->twitter->replies();

it works just fine. Anyone else run into this? Or can anyone help me discover why these aren't working?

Thx in advance!


Does anyone know how to list twitter status messages on a page?
It works fine do update the status and run through the messages with the below code
but how do I write out the message text for each message?

Right now I can only see that the Foreach has looped through the list as many times as I got status messages, but I would like to print out the ID and message text of each status so that I can delete via the API too.

$data['details'] = $this->twitter->user_timeline();

Thankful for all help!

Kind Regards,

Hi again,

I solved the listing of status messages. Got another small problem now.
The deletion (destoy) of status messages is not doing it´s job. No messages gets deleted.

What can be wrong?

Wow excellent thanks!

Now all I have to do is find an excuse to put it on one of my sites ! Big Grin

Keep up the good work!


I seem to have fixed the deletion problem too now but if I got one (1) or less messages on my twitter account there is an error message. If I got 2 or more messages there are not errors. What is wrong?

[eluser]Phil Sturgeon[/eluser]
You need to call this library TwitIgniter.

[eluser]Tom Schlick[/eluser]
@pyromaniac - or how bout "bird caught on fire by the total awesomeness of codeigniter... and gasoline"

Theme © iAndrew 2016 - Forum software by © MyBB