public
Description: An extensible bot for the Campfire web-based chat system #crc
Homepage:
Clone URL: git://github.com/timriley/campfire-bot.git
check for ssl support in the basecamp plugin. doesn't work if ssl is required 
but we're still using http
timriley (author)
Mon Nov 24 18:39:49 -0800 2008
commit  c3307d79aa30188def0a6d1084c21e005c6679ad
tree    6eb21555d0e75692a67268d147ce51bf3640df09
parent  8c3cc88d6e74176f4990f3c36b70bdfe3ca243bf
...
10
11
12
 
13
14
15
...
21
22
23
24
 
25
26
27
28
29
30
31
32
33
...
10
11
12
13
14
15
16
...
22
23
24
 
25
26
27
28
29
 
 
30
31
32
0
@@ -10,6 +10,7 @@ class Basecamp < CampfireBot::Plugin
0
     @domain     = @writeboard.split(/\/+/)[1]
0
     @username   = bot.config['basecamp_username']
0
     @password   = bot.config['basecamp_password']
0
+    @ssl        = !!bot.config['basecamp_use_ssl']
0
   end
0
   
0
   def writeboard(msg)
0
@@ -21,13 +22,11 @@ class Basecamp < CampfireBot::Plugin
0
   # TODO escape stuff here. output = `#{Escape.shell_command(['figlet', '--', m[:message]])}`
0
   def get_contents
0
     # Prime the cookie jar: log in.
0
-    basecamp_login      = `curl -c #{@cookie_jar} -b #{@cookie_jar} -d "user_name=#{@username}&password=#{@password}" -L #{@domain}/login/authenticate`
0
+    basecamp_login      = `curl -c #{@cookie_jar} -b #{@cookie_jar} -d "user_name=#{@username}&password=#{@password}" -L http#{'s' if @ssl}://#{@domain}/login/authenticate`
0
     
0
     # Now fetch the contents of the writeboard redirect page
0
     writeboard_redir    = `curl -c #{@cookie_jar} -b #{@cookie_jar} -L #{@writeboard}`
0
     
0
-    p writeboard_redir
0
-    
0
     # Now simulate the javascripted login to the writeboard site
0
     redir_form          = Hpricot(writeboard_redir).search('form').first
0
     writeboard_url      = redir_form['action'].gsub(/\/login$/, '')

Comments