Skip to content
Browse files

RT regex in reaction_processor so it accomodates :

  • Loading branch information...
1 parent 8077e92 commit f440c1898684405e7cf45c34afa56a5df651312f Sam Gilbert committed Dec 17, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/wetk_twitter/reaction_processor.rb
View
8 lib/wetk_twitter/reaction_processor.rb
@@ -27,6 +27,7 @@ def process_reactions()
influentials[:rt_screen_names].each do |screen_name|
save_from(screen_name, tweet, 'retweet')
end
+ pull_and_save_rts_from
end
end
end
@@ -55,7 +56,7 @@ def tweets_from_tweet_ids(tweet_ids)
def parse_tweet_for_influentials(tweet)
mention_regex = /[@]\w+/
reply_regex = /^[@]\w+/
- rt_regex = /(^[Rr][Tt] ?[@]\w+| [Rr][Tt] ?[@]\w+)/
+ rt_regex = /(^[Rr][Tt] ?[@]\w+(:?)| [Rr][Tt] ?[@]\w+(:?))/
t_copy = tweet.text.dup
reply_screen_name = t_copy.scan(reply_regex)
reply_screen_name.each do |ru|
@@ -70,7 +71,6 @@ def parse_tweet_for_influentials(tweet)
end
mention_screen_names = t_copy.scan(mention_regex)
sanitize_screen_names(reply_screen_name.first, rt_screen_names, mention_screen_names)
-
end
def sanitize_screen_names(reply_screen_name, rt_screen_names, mention_screen_names)
@@ -84,6 +84,7 @@ def sanitize_screen_names(reply_screen_name, rt_screen_names, mention_screen_nam
end
{:reply_screen_name => reply_screen_name, :rt_screen_names => rt_screen_names, :mention_screen_names => mention_screen_names}
end
+
def fill_in_user_info
if not user.db_user_info
user.db_user_info = $PULLER.pull({:user=>user}, &USER_PULL)
@@ -101,5 +102,8 @@ def find_or_create_secondary_account(screen_name)
end
end
+ def pull_and_save_rts_from
+
+ end
end

0 comments on commit f440c18

Please sign in to comment.
Something went wrong with that request. Please try again.