Module: Croudia::Rest::Statuses

Included in:
Client
Defined in:
lib/croudia/rest/statuses.rb

Instance Method Summary collapse

Instance Method Details

#comment(params = {}) ⇒ Croudia::Object::Status

Returns Commented status.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :id (Integer)

    Comment status id.

  • :status (String)

    Comment body.

  • :trim_user (Boolean)

    When set to true, whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



149
150
151
152
# File 'lib/croudia/rest/statuses.rb', line 149

def comment(params = {})
  response = post('2/statuses/comment.json', params)
  Croudia::Object::Status.new(response)
end

#comment_with_media(params = {}) ⇒ Croudia::Object::Status

Returns Commented status.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :id (Integer)

    Comment status id.

  • :status (String)

    Comment body.

  • :media (File)

    Attachment media.

  • :trim_user (Boolean)

    When set to true, whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



164
165
166
167
# File 'lib/croudia/rest/statuses.rb', line 164

def comment_with_media(params = {})
  response = post('2/statuses/comment_with_media.json', params)
  Croudia::Object::Status.new(response)
end

#delete_status(status, params = {}) ⇒ Croudia::Object::Status Also known as: delete_spread

Deletes the authenticating user’s status.

Parameters:

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



108
109
110
111
# File 'lib/croudia/rest/statuses.rb', line 108

def delete_status(status, params = {})
  response = post("2/statuses/destory/#{status.id}.json", params)
  Croudia::Object::Status.new(response)
end

#home_timeline(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, each whisper returned in a timeline will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

  • :since_id (Integer)

    Returns results with an ID greater than (that is, more recent than) the specified ID.

  • :max_id (Integer)

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer)

    Specifies the number of statuses to retrieve.



32
33
34
35
# File 'lib/croudia/rest/statuses.rb', line 32

def home_timeline(params = {})
  response = get('2/statuses/home_timeline.json', params)
  response.map{ |status| Croudia::Object::Status.new(status) }
end

#mentions_timeline(params = {}) ⇒ Array<Croudia::Object::Status>

Returns the 20 most recent mentions (Whispers containing a users’s @screen_name) for the authenticating user.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, each whisper returned in a timeline will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

  • :since_id (Integer)

    Returns results with an ID greater than (that is, more recent than) the specified ID.

  • :max_id (Integer)

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer)

    Specifies the number of statuses to retrieve.

Returns:

See Also:



64
65
66
67
# File 'lib/croudia/rest/statuses.rb', line 64

def mentions_timeline(params = {})
  response = get('2/statuses/mentions.json', params)
  response.map{ |status| Croudia::Object::Status.new(status) }
end

#public_timeline(params = {}) ⇒ Array<Croudia::Object::Status>

Returns a collection of the most recent Whispers, spreads and comments posted by the authenticating user and the users they non-protected.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, each whisper returned in a timeline will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

  • :since_id (Integer)

    Returns results with an ID greater than (that is, more recent than) the specified ID.

  • :max_id (Integer)

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer)

    Specifies the number of statuses to retrieve.

Returns:

See Also:



17
18
19
20
# File 'lib/croudia/rest/statuses.rb', line 17

def public_timeline(params = {})
  response = get('2/statuses/public_timeline.json', params)
  response.map{ |status| Croudia::Object::Status.new(status) }
end

#spread(status, params = {}) ⇒ Croudia::Object::Status

Shares the status by authenticating user.

Parameters:

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



135
136
137
138
# File 'lib/croudia/rest/statuses.rb', line 135

def spread(status, params = {})
  response = post("2/statuses/spread/#{status.id}.json", params)
  Croudia::Object::Status.new(response)
end

#status(status, params = {}) ⇒ Croudia::Object::Status

Returns a single Whisper, specified by the id parameter.

Parameters:

Options Hash (params):

  • :trim_user (Boolean)

    When set to true, whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



122
123
124
125
# File 'lib/croudia/rest/statuses.rb', line 122

def status(status, params = {})
  response = get("2/statuses/show/#{status.id}.json", params)
  Croudia::Object::Status.new(response)
end

#update_status(params = {}) ⇒ Croudia::Object::Status

Updates the authenticating user’s current status.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :status (String)

    The text of your status update, typically up to 372 characters.

  • :in_reply_to_status_id (Integer)

    The ID of an existing status that the update is in reply to.

  • :timer (Integer)

    Whispers timer’s seconds.

  • :trim_user (Boolean)

    When set to true, the whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



79
80
81
82
# File 'lib/croudia/rest/statuses.rb', line 79

def update_status(params = {})
  response = post('2/statuses/update.json', params)
  Croudia::Object::Status.new(response)
end

#update_status_with_media(params = {}) ⇒ Croudia::Object::Status

Updates the authenticating user’s current status with media as photos.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :status (String)

    The text of your status update, typically up to 372 characters.

  • :media (File)

    Attachment image that PNG, JPEG or GIF format.

  • :in_reply_to_status_id (Integer)

    The ID of an existing status that the update is in reply to.

  • :timer (Integer)

    Whispers timer’s seconds.

  • :trim_user (Boolean)

    When set to true, the whisper returned will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

Returns:

See Also:



95
96
97
98
# File 'lib/croudia/rest/statuses.rb', line 95

def update_status_with_media(params = {})
  response = post('2/statuses/update_with_media.json', params)
  Croudia::Object::Status.new(response)
end

#user_timeline(params = {}) ⇒ Array<Croudia::Object::Status>

Returns a collection of the most recent Whispers, spreads and comments posted by specified user.

Parameters:

  • params (Hash) (defaults to: {})

    A customized options.

Options Hash (params):

  • :screen_name (String)

    The screen name of the user for whom to return results for.

  • :user_id (Integer)

    The ID of the user for whom to return results for.

  • :trim_user (Boolean)

    When set to true, each whisper returned in a timeline will include a user object including only the status authors numerical ID.

  • :include_entities (Boolean)

    The entities node will be omitted when set to false.

  • :since_id (Integer)

    Returns results with an ID greater than (that is, more recent than) the specified ID.

  • :max_id (Integer)

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer)

    Specifies the number of statuses to retrieve.

Returns:

See Also:



49
50
51
52
# File 'lib/croudia/rest/statuses.rb', line 49

def user_timeline(params = {})
  response = get('2/statuses/user_timeline.json', params)
  response.map{ |status| Croudia::Object::Status.new(status) }
end