dm: Functions to manipulate Twitter direct messages

Description Usage Arguments Value Author(s) See Also Examples

Description

These functions allow you to interact with, send, and delete direct messages (DMs) in Twitter.

Usage

1
2
3
4
dmGet(n=25, sinceID=NULL, maxID=NULL, ...)
dmSent(n=25, sinceID=NULL, maxID=NULL, ...)
dmDestroy(dm, ...)
dmSend(text, user, ...)

Arguments

text

The text of a message to send

user

The user to send a message to, either character or an user object.

dm

The message to delete, an object of class directMessage

n

The maximum number of direct messages to return

sinceID

If not NULL, an ID representing the earliest boundary

maxID

If not NULL, an ID representing the newest ID you wish to retrieve

...

Further arguments to pass along the communication chain

Value

These functions will not work without OAuth authentication

The dmGet and dmSent functions will return a list of directMessage objects. The former will retrieve DMs sent to the user while the latter retrieves messages sent from the user.

The dmDestroy function takes a directMessage object (perhaps from either dmGet or dmSent) and will delete it from the Twitter server.

The dmSend function will send a message to another Twitter user.

Author(s)

Jeff Gentry

See Also

directMessage, registerTwitterOAuth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  ## Not run: 
           dms <- dmGet()
           dms
           ## delete the first one
           dms[[1]]$destroy()
           dmDestroy(dms[[2]])
           ## send a DM
           dmSend('Testing out twitteR!', 'twitter')
   
## End(Not run)

ashoksiri/twitteR documentation built on May 8, 2019, 5:57 p.m.