PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 8, 2022

[FIXED] How to tweet message on logeed in user profile

 July 08, 2022     php, posts, tweets     No comments   

Issue

I Have integrated tweeter connect with my website.I have used oauth code to post on tweeter. I have mentioned part of the code what I have used below.

$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
// Your Message
$message = "hi I am fine";
// Send tweet     
$tweet->post('statuses/update', array('status' => "$message"));

But I can not post on the user page who is logged in ,It only shows on application's user page, should I add anything with this code?if so please let me know what should I do with code.


Solution

This code is alright. It will work.

But the main thing is to figure out what is the error and why it's not working. Simply replace

$tweet->post('statuses/update', array('status' => "$message"));

using:

$mytweet=$tweet->post('statuses/update', array('status' => "$message"));
var_dump($mytweet); 
// print the output coming from the post request, that you done using twitterOauth

I already have used the same code, first time it's not working as my Application was Read Only Type and now works properly! So, make sure your Application settings is Read and Write type at least. Here the solution in details: https://stackoverflow.com/questions/18035906/tweeting-with-php-not-working/18036339#18036339



Answered By - Jaber Ibne Mahboob
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing