Learn R Programming

twitteR (version 0.99.2)

directMessage-class: Class "directMessage": A class to represent Twitter Direct Messages

Description

Provides a model representing direct messages (DMs) from Twitter

Arguments

Details

The directMessage class is implemented as a reference class. As there should be no backwards compatibility issues, there are no S4 methods provided as with the user and status classes. An instance of a generator for this class is provided as a convenience to the user as it is configured to handle most standard cases. To access this generator, use the object dmFactory. Accessor set & get methods are provided for every field using reference class $accessors() methodology (see setRefClass for more details). As an example, the sender field could be accessed using object$getSender() and object$setSender().

The constructor of this object assumes that the user is passing in a JSON encoded Twitter Direct Message. It is also possible to directly pass in the arguments.

See Also

dmGet, dmSend, dmDestroy, setRefClass

Examples

Run this code
## This example is run, but likely not how you want to do things
  dm <- dmFactory$new(text='foo', recipientSN='blah')
  dm$getText()
  
  ## assume 'json' is the return from a Twitter call
    dm <- dmFactory$new(json)
    dm$getSenderID()

Run the code above in your browser using DataLab