Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send a Direct message using Abraham's oauth library

Tags:

php

twitter

I'm using this library ... http://github.com/abraham/twitteroauth

I am able to update statuses and stuff but can't seem to find a function for direct messages.

Also, is there any other library that I could use?

like image 573
Suhas Avatar asked Dec 13 '25 18:12

Suhas


1 Answers

Sending a direct message works almost the same as posting a status.

$twitteroauth->post('statuses/update', array('status' => 'status text here'));

$twitteroauth->post('direct_messages/new', array('text' => 'dm text here', 'screen_name' => 'recipients screen_name'));

like image 73
abraham Avatar answered Dec 15 '25 10:12

abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!