Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a new command "includeatreplies" to fix already added imaginary f…

…riends.
  • Loading branch information...
commit 09a3a6654539ed2a248b0909c844d58dd57ec753 1 parent f41a56d
@knu authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 bin/tw2ff
View
26 bin/tw2ff
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.