Skip to content
Steve Hannah edited this page Jun 25, 2021 · 1 revision

Tweet

Synopsis

A model class for encapsulating a single "Tweet" or "News Item".

Properties

author

Type

TWTAuthor

Description

Author of the tweet

Tags

TweetSchema.author

authorIcon

Type

String

Description

The URL to an image/icon of the author of the tweet. Use this or author, but not both.

Tags

TweetSchema.authorIcon

authorId

Type

String

Description

The ID of the author of the tweet. Use this or author, but not both.

Tags

TweetSchema.authorId

Text

Type

String

Description

The text content of the tweet.

Tags

TweetSchema.text

datePosted

Type

Date

Description

The date that the tweet was posted.

Tags

TweetSchema.datePosted

numLikes

Type

int

Description

The number of "likes" the tweet has received.

Tags

TweetSchema.numLikes

numReplies

Type

int

Description

The number of replies the tweet has received.

Tags

TweetSchema.numReplies

numRetweets

Type

int

Description

The number of times this tweet has been retweeted.

Tags

TweetSchama.numRetweets

Type

String

Description

If this tweet includes a link to a webpage, this can contain its URL.

Tags

TweetSchema.link

image

Type

String

Description

If this tweet includes an image, this can contain its URL.

Tags

TweetSchema.image

linkSubject

Type

String

Description

Text describing the link if a link is included.

Tags

TweetSchema.linkSubject

inReplyTo

Type

Tweet

Description

If this tweet is in reply to another tweet, this is a reference to that tweet.

Tags

TweetSchema.inReplyTo

subscriptionSource

Type

String

Description

If this tweet originated from some site, this may contain the sites name.

Tags

TweetSchema.subscriptionSource

numViews

Type

int

Description

The number of times this tweet has been viewed.

Tags

TweetSchema.numViews

Usage

Use the TweetImpl class to create instances of this entity.

E.g.

Tweet tweet = new TweetImpl();
tweet.setText("Hello World");
tweet.setDatePosted(someDate);
tweet.setImage("https://exmaple.com/path/to/image.png");
... etc ...

You can also "wrap" other entities with compatible properties (i.e. properties that are tagged with the same tags as corresponding properties in Tweet) to use the Tweet API on them.

Tweet tweet = TweetWrapper.wrap(someEntity);
String text = tweet.getText();
... etc ...
Clone this wiki locally