आप अपने व्यक्तिगत टोकन आप से एप्लिकेशन पेज dev.twitter.com पर मिलता है और Sign in with Twitter
बिना उपयोग कर सकते हैं देखे बिना चहचहाना के माध्यम से सीधे संदेश भेजने की आवश्यकता है।
- उपभोक्ता कुंजी
- उपभोक्ता सीक्रेट
और Your access token
प्राप्त तहत:
- पहुँच टोकन
अनुभाग
OAuth settings
प्राप्त तहत
अपना ऐप्लिकेशन पृष्ठ पर
- एक्सेस टोकन गुप्त
जांचें कि पहुंच स्तर Read, write, and direct messages
है। अन्यथा इसे Settings
टैब में बदलें और अपने एक्सेस टोकन को फिर से बनाएं (Details
टैब के नीचे एक बटन है)।
फिर php में
require('Abrahams library');
// Get everything you need from the dev.twitter.com/apps page
$consumer_key = 'APP KEY';
$consumer_secret = 'APP SECRET';
$oauth_token = 'YOUR TOKEN';
$oauth_token_secret = 'YOUR TOKEN SECRET';
// Initialize the connection
$connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
// Send a direct message
$options = array("screen_name" => "theGuyIWantToDM", "text" => "Hey that's my message");
$connection->post('direct_messages/new', $options);
आप [dev.twitter.com] पर आपके एप्लिकेशन पेज (https://dev.twitter.com/apps) से आपकी व्यक्तिगत टोकन प्राप्त और बिना उपयोग कर सकते हैं 'ट्विटर के साथ साइन इन करें'। – maxdec