How can I use php script to send tweet to twitter, it is not working. can someone help? This is the posting code $tweet->post ('statuses/update', array ('status' => $tweetMessage));
-
This is the full code, the script runs but no tweet posted. Obviously i removed my credentials for security purposes. <?php //use the twitteroauth require_once('twitteroauth.php'); require_once('OAuth.php'); //initialize keys $consumerKey = ''; $consumerSecret = ''; $accessToken = ''; $accessTokenSecret = ''; //create twitter object $tweet = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); //assign status message $tweetMessage ="This is a tweet to my Twitter account via PHP."; //check 140 characters limit if(strlen($tweetMessage)<= 140) $tweet->post('statuses/update',array('status' => $tweetMessage)); echo 'success'; ?>
-
Answer:
Ok I know what's the problem. You application credentials is only set to Read only. Which means you can post or update anything. You only can read tweet and your profile info. In order to change that, go to https://dev.twitter.com. Log in and then go to "My Applications". Click on your application name. Then click on "Settings" tab. Scroll down to "Application Type" and you will "Access" section. Click at "Read and Write" and then update your settings. It might take a while. Then you need to regenerate your access token. After that, update the access token and access token secret on your application. It should work.
Puunithaaraj Gopal at Quora Visit the source
Related Q & A:
- How can I use SSL with django?Best solution by Stack Overflow
- How can I use XMP in Sharepoint metadata?Best solution by Stack Overflow
- How can I use my personal pictures at Yahoo and send them via Yahoo mail?Best solution by in.answers.yahoo.com
- How do I use yahoo mail to send free text messages to mobile phones?Best solution by Yahoo! Answers
- How can I enable Java script?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.