I’m developing a mobile website that involves posting to Twitter. I needed a simple starting point to build upon and came across a website which had the perfect PHP code for doing what I needed.
Here is the code I found: DiscussDesk - PHP Code to Post to Twitter
Here is a Demo of it working on their site: Demo of PHP Posting to Twitter
I can’t seem to get this code working however. I have set up the app in Twitter Dev Dashboard, added the access keys to the config file, and have been a bit confused with the callback url. I have loaded the code to my own website at: http://twitter.chris-alexander.com so my first question it - would this URL I’ve loaded it to be the callback url? Would it be for both the Twitter App Dashboard and the php config file? I’ve seen other examples show something like: http://twitter.chris-alexander?source=twitter for one of them.
I’ve tried multiple iterations of the call back url like above, but maybe I’m missing something? The demo site that is above makes a call to Twitter and grabs the access tokens. You can see that the code works, but it seems I’m doing something wrong. Or, maybe this code is out of date?
I have added the code to a repository at https://github.com/cmalexander/php-post-to-twitter/tree/master
Any help or direction would be greatly appreciated!
Chris