NAME

BusyBird::Manual::Status - Status object specification

SYNOPSIS

use JSON;

my $status = decode_json(<<'STATUS');
{
    "id": "http://api.example.com/2291",
    "created_at": "Thu Jan 03 02:24:43 +0000 2013",
    "text": "sample status",
    "user": {
        "screen_name": "debug_ito",
        "profile_image_url": "http://img.example.com/user/debug_ito.png",
        "name": "Toshio Ito"
    },
    "busybird": {
        "level": 0,
        "acked_at": "Thu Jan 03 14:44:12 +0900 2013",
        "status_permalink" : "http://example.com/status/2291"
    }
}
STATUS

DESCRIPTION

This is the specification of a status object handled by BusyBird (especially BusyBird::StatusStorage and BusyBird::Timeline).

A status object is just a hash reference (or an Object in JSON format). It should be serializable to JSON and deserializable from JSON.

FIELDS

The following fields in a status object is used by BusyBird.

Note that the following list uses JSON for key notation. For example, busybird.acked_at field is $status->{busybird}{acked_at} in Perl (NOT $status->{"busybird.acked_at"}).

Status object can have fields that are not listed in this page. BusyBird tries to keep such fields untouched.

busybird.acked_at

The timestamp string at which the status is acked. If this field does not exist or it's null, the status is unacked.

The timestamp string must be parsable by BusyBird::DateTime::Format.

busybird.level

The level of the status. Level must be an integer. It may be positive or negative.

If not set, it is considered as 0.

busybird.original.id

The original ID of the status. You should set this field when you somehow convert status ID.

ID conversion is necessary when you import statuses from multiple sources with their own ID spaces, and you want to avoid ID conflict between them. BusyBird::Filter::Twitter does such conversion, for example.

If this field is set, BusyBird uses this field if necessary, e.g., when it builds permalink to the status.

If set, this string is used for the permalink URL of the status.

To further customize status permalinks, see status_permalink_builder of BusyBird::Manual::Config.

created_at

The timestamp string at which the status is created.

The timestamp string must be parsable by BusyBird::DateTime::Format.

To customize the way BusyBird renders this timestamp, see time_zone, time_format, time_locale of BusyBird::Manual::Config.

entities

Object containing Twitter Entities.

Twitter Entities are objects annotating the status text. Currently BusyBird reads the following fields to create hyperlinks in the text.

  • entities.hashtags

  • entities.media

  • entities.urls

  • entities.user_mentions

To customize the way it renders those hyperlinks and annotated texts, see *_entitiy_url_builder and *_entity_text_builder of BusyBird::Manual::Config.

id

ID of the status. ID may be an arbitrary string.

Status ID must be unique in a timeline. If you try to input a status whose ID already exists in the timeline, the input status is ignored.

retweeted_status

Nested status object that is the original retweeted status.

If this field is set, BusyBird considers the status containing this field is a retweet. It then renders the status in retweeted_status field and who retweeted this.

text

Status text string. The body of the status.

user.profile_image_url

URL string of the icon image of the person who created this status.

user.screen_name

Name of the person who created this status.

AUTHOR

Toshio Ito <toshioito [at] cpan.org>