Index: lang/ruby/misc/wassr_follow_in_twitter_json.rb
===================================================================
--- lang/ruby/misc/wassr_follow_in_twitter_json.rb (revision 21254)
+++ lang/ruby/misc/wassr_follow_in_twitter_json.rb (revision 21385)
@@ -9,14 +9,14 @@
 Net::HTTP.version_1_2
 
-TWITTER_API = URI('http://twitter.com/')
-WASSR_API = URI('http://api.wassr.jp/') 
+TWITTER_API = URI("https://twitter.com/")
+WASSR_API = URI("http://api.wassr.jp/")
 
-twitter_account = Pit.get('twitter.com', :require => {
-  :username => 'please set your username',
-  :password => 'please set your password',
+twitter_account = Pit.get(TWITTER_API.host, :require => {
+	:username => 'Please set your username for Twitter.',
+	:password => 'Please set your password for Twitter.',
 })
-wassr_account = Pit.get('wassr.jp', :require => {
-  :username => 'please set your username',
-  :password => 'please set your password',
+wassr_account = Pit.get(WASSR_API.host, :require => {
+	:username => 'Please set your username for Wassr.',
+	:password => 'Please set your password for Wassr.',
 })
 
@@ -28,5 +28,5 @@
 			json = JSON.parse(open(api + "statuses/friends.json?page=#{page}", :http_basic_authentication => [account[:username], account[:password]]).read)
 			break if json.empty?
-			
+
 			json.each do |user|
 				friends << user["screen_name"]
@@ -52,11 +52,11 @@
 begin
 	friends.each do |name|
-		next unless /^[a-z0-9]+$/ =~ name
-		req = Net::HTTP::Post.new( "/friendships/create/#{name}.json", '' )
+		next unless /^[a-z0-9][-a-z0-9_]{1,18}[a-z0-9]$/ =~ name
+		req = Net::HTTP::Post.new( "#{WASSR_API.path}friendships/create/#{name}.json", '' )
 		req.basic_auth wassr_account[:username], wassr_account[:password]
 		Net::HTTP.start( WASSR_API.host ) do |http|
 			response = http.request(req)
 			json = JSON.parse(response.body)
-			unless json.has_key? 'error' 
+			unless json.has_key? 'error'
 				puts "#{name} is followed." if json["status"] == 'ok'
 			end
