Welcome Guest, Not a member yet? Register   Sign In
tmhOAuth (PHP Twitter OAuth library) port to CodeIgniter

Hello guys,

I needed to have working the tmhOAuth OAuth Twitter library on my CodeIgniter project and what I did was to port this library as a CodeIgniter library with some more changes (some new methods for easy access).

You can find the library here:

I made a small application as an example:

What this application does: it lets you log in with your Twitter Application, modifies your Twitter Profile Image, add two accounts to your following list (if checked) and post a message to twitter (if checked).

All the code for this application is released too. I'm not the best programmer, but I wanted to share this code with you all.

Regards :]

Hi there - this seems really great, i'm just getting into Codeigniter and need to setup some sort of twitter integration, so this is great!

I've downloaded your app and it doesn't appear to be working correctly, on clicking the sign in with twitter button, nothing happens? The page reloads, the url states the correct URI but no twitter redirection.

Anything you can recommend? Would love to get this up and running!



Hey include,

Just a few minor notes:
- On application/config/ you'll see a list of /config/*.exampe.php items. Just be sure to modify all of them with your current settings.
- Did you create a Twitter Application and modified the /config/twitter.php file?
- Check the logs, maybe they say something Tongue

I have to document everything, I will do it as soon as possible.

Thanks for the response :-)

Yeah changed all the example config files to work with my database, config and twitter credentials.

Once you click the login button, it appears to be loading something, but then does nothing.

What version of CI should i be using?

Thanks again!

Its CI 2.0 Smile

[quote author="demogar" date="1297134546"]Its CI 2.0 Smile[/quote]

Hi demogar,

I need this lib for 1.7.* version of CI. Is there any way I can get it?


Hey Atharva,

Did you try it under CI 1.7? If so: what didn't work under CI 1.7?

Yes, I tried with 1.7.2 with correct consumer and secret key, but it redirects me to https://api.twitter.com/oauth/authorize?oauth_token= with no oauth_token which shows error like
Quote:Woah there!

This page is no longer valid. It looks like someone already used the token information you provided. Please return to the site that sent you to this page and try again … it was probably an honest mistake.

I am not sure if this error is related with your lib. Just wanted to confirm .


Make sure you are using under your config.php file PATH_INFO for the uri_protocol, like this:

$config['uri_protocol']    = "PATH_INFO"

I will make a tiny documentation as soon as possible, maybe by the end of the week.

If you are using CI 2.0, and you want to allow GET parameters on your controller, you can use the method described here:

Also, in CI 2.0, instead of PATH_INFO you may try "REQUEST_URI" under your config.php file.

Theme © iAndrew 2016 - Forum software by © MyBB