ip-writer-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.textile +19 -0
- data/Rakefile +1 -0
- data/lib/ip-writer-rails.rb +23 -0
- metadata +73 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 Jonathan Vingiano
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
h1. ip-writer-rails
|
2
|
+
|
3
|
+
p. "Kim Asendorf's":http://kimasendorf.com/ "IP Writer":http://kimasendorf.com/ipwriter ported to Ruby for use in for Rails applcations. IP Writer reads the IP address of a visitor to a website and tweets it. By default it will tweet to the IP Writer twitter account, although you may configure it to tweet from any account you have access to.
|
4
|
+
|
5
|
+
h2. Installation
|
6
|
+
|
7
|
+
p. Include IPWriter in your Gemfile: @gem 'ip-writer-rails'@.
|
8
|
+
|
9
|
+
h2. Usage
|
10
|
+
|
11
|
+
p. Using IPWriter is simple. Just include the @ip_writer@ method anywhere in a controller.
|
12
|
+
|
13
|
+
pre.
|
14
|
+
class HomeController < ApplicationController
|
15
|
+
def index
|
16
|
+
ip_writer
|
17
|
+
......
|
18
|
+
end
|
19
|
+
end
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "ip-writer-rails/version"
|
2
|
+
require "twitter"
|
3
|
+
|
4
|
+
module IPWriter
|
5
|
+
|
6
|
+
def ip_writer(consumer_key='4IIcFWiOs5JQi4vI2umTTw', consumer_secret='Cc9bjleqldFfnSDB1nPaMDABjsTseYwq1cLPAnnk', oauth_token='45836347-39kiTx3oYBz1dtRUHQTFxrdVPj1NYPH2AO1XcPkfh', oauth_secret='SoIXUYgC1Tl06xoUpVflzdR9ERvkV4PMuWKQFJupqk')
|
7
|
+
|
8
|
+
Twitter.configure do |config|
|
9
|
+
config.consumer_key = consumer_key
|
10
|
+
config.consumer_secret = consumer_secret
|
11
|
+
config.oauth_token = oauth_token
|
12
|
+
config.oauth_token_secret = oauth_secret
|
13
|
+
end
|
14
|
+
begin
|
15
|
+
Twitter.update(request.remote_ip)
|
16
|
+
rescue Exception => e
|
17
|
+
puts "Error: #{e}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
ActionController::Base.send :include, IPWriter
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ip-writer-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jonathan Vingiano
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-31 00:00:00.000000000 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rails
|
17
|
+
requirement: &2156042940 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *2156042940
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: twitter
|
28
|
+
requirement: &2156042140 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2156042140
|
37
|
+
description: Read the IP Address of a visitor to your website and tweet it.
|
38
|
+
email:
|
39
|
+
- jgv@jonathanvingiano.com
|
40
|
+
executables: []
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- lib/ip-writer-rails.rb
|
45
|
+
- MIT-LICENSE
|
46
|
+
- Rakefile
|
47
|
+
- README.textile
|
48
|
+
has_rdoc: true
|
49
|
+
homepage: http://github.com/jgv/ip-writer-rails
|
50
|
+
licenses: []
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project: ip-writer-rails
|
69
|
+
rubygems_version: 1.6.2
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Ruby fork of Kim Asendorf's IP Writer
|
73
|
+
test_files: []
|