Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- httpauth = Twitter::HTTPAuth.new( current_account.twitter_username, current_account.twitter_password )
- client = Twitter::Base.new(httpauth)
- # TO DO -- Yep, should filter the request to only get tweets since the last check
- client.friends_timeline.each do |tweet|
- # TO DO -- Yep, need to check to see if the tweet is already in there
- status = Status.create(
- :status_created_at => tweet.status_created_at,
- :status_id => tweet.id,
- :message => tweet.text,
- :source => tweet.source,
- :truncated => tweet.truncated,
- :in_reply_to_status_id => tweet.in_reply_to_status_id,
- :in_reply_to_user_id => tweet.in_reply_to_user_id,
- :favorited => tweet.favorited,
- :in_reply_to_screen_name => tweet.in_reply_to_screen_name
- )
- twitter_user = TwitterUser.find_or_create_user( tweet.user )
- twitter_user.statuses << status
Add Comment
Please, Sign In to add comment