Class: Wuclan::Twitter::Model::ARetweetsB

Inherits:
Object
  • Object
show all
Includes:
ModelCommon, RelationshipBase
Defined in:
lib/wuclan/twitter/model/relationship.rb

Overview

A re-tweet is /sent/ by user_a, repeating an earlier message by user_b Any tweet containing text roughly similar to

RT @user <stuff>

with equivalently for RT: retweet, via, retweeting

!!! OR !!!

A retweet whore request, something like

pls RT Hey lookit me

We just pass along both in the same data structure; the heuristic is poor enough that we leave it to later steps to be clever. (Note retweets and non-retweet-whore-requests have user_b_name set and unset respectively.)

user_a_id: the user who sent the re-tweet status_id: the id of the tweet containing the re-tweet (for the ID of the original tweet you’re on your own.) user_b_name: the user citied as originating: RT @user_b_name please_flag: a 1 if the text contains ‘please’ or ‘plz’ as a stand-alone word text: the full text of the tweet

Instance Method Summary collapse

Methods included from RelationshipBase

included

Methods included from ModelCommon

#days_since_created, flatten_date, #key, #scrape_age, unbooleanize, zeropad_id

Constructor Details

#initialize(*args) ⇒ ARetweetsB

Returns a new instance of ARetweetsB.



130
131
132
133
# File 'lib/wuclan/twitter/model/relationship.rb', line 130

def initialize *args
  super *args
  self.please_flag = ModelCommon.unbooleanize(self.please_flag)
end

Instance Method Details

#is_retweet?Boolean

If there’s no user we’ll assume this is a retweet and not an rtwhore.

Returns:

  • (Boolean)


141
142
143
# File 'lib/wuclan/twitter/model/relationship.rb', line 141

def is_retweet?
  ! user_b_name.blank?
end

#num_key_fieldsObject

Key on retweeting_user-user-tweet_id



135
# File 'lib/wuclan/twitter/model/relationship.rb', line 135

def num_key_fields()  3  end

#numeric_id_fieldsObject



136
# File 'lib/wuclan/twitter/model/relationship.rb', line 136

def numeric_id_fields()     [:user_a_id, :status_id] ; end