Module: IPWriter

Defined in:
lib/ip-writer-rails.rb

Instance Method Summary collapse

Instance Method Details

#ip_writer(consumer_key = '4IIcFWiOs5JQi4vI2umTTw', consumer_secret = 'Cc9bjleqldFfnSDB1nPaMDABjsTseYwq1cLPAnnk', oauth_token = '45836347-39kiTx3oYBz1dtRUHQTFxrdVPj1NYPH2AO1XcPkfh', oauth_secret = 'SoIXUYgC1Tl06xoUpVflzdR9ERvkV4PMuWKQFJupqk') ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ip-writer-rails.rb', line 6

def ip_writer(consumer_key='4IIcFWiOs5JQi4vI2umTTw', consumer_secret='Cc9bjleqldFfnSDB1nPaMDABjsTseYwq1cLPAnnk', oauth_token='45836347-39kiTx3oYBz1dtRUHQTFxrdVPj1NYPH2AO1XcPkfh', oauth_secret='SoIXUYgC1Tl06xoUpVflzdR9ERvkV4PMuWKQFJupqk')
  
  Twitter.configure do |config|
    config.consumer_key = consumer_key
    config.consumer_secret = consumer_secret
    config.oauth_token = oauth_token
    config.oauth_token_secret = oauth_secret
  end
  begin
    Twitter.update(request.remote_ip)
  rescue Exception => e
    puts "Error: #{e}"
  end
end