Skip to content

Commit

Permalink
Add a new command "includeatreplies" to fix already added imaginary f…
Browse files Browse the repository at this point in the history
…riends.
  • Loading branch information
knu committed Jun 1, 2010
1 parent f41a56d commit 09a3a66
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/tw2ff
Expand Up @@ -367,6 +367,32 @@ to see if someone is joining FriendFeed:
end
end

mode 'includeatreplies' do
description 'Fix imaginary friends to include @replies'

def run
ffcli = friendfeed_client()

putinfo "Checking imaginary friends in FriendFeed..."
ffcli.get_imaginary_friends.each { |profile|
id = profile['id']
ffcli.get_services(id).each { |service|
url = service['profileUrl'] or next

if (name = TWITTER_URI.route_to(url).to_s).match(/\A[A-Za-z0-9_]+\z/)
name.downcase!
putinfo 'Trying to include @replies by %s', name
begin
ffcli.edit_service(id, service['serviceid'], 'includeatreplies' => 'on')
rescue => e
putinfo 'Failed, maybe due to the Twitter account removal or a network problem.'
end
end
}
}
end
end

mode 'favorites' do
description 'Synchronize Twitter favorites and FriendFeed likes as far as possible'

Expand Down

0 comments on commit 09a3a66

Please sign in to comment.