wangiry 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +1 -0
- data/bin/wangiry +12 -0
- data/lib/wangiry.rb +14 -0
- data/lib/wangiry/version.rb +3 -0
- data/wangiry.gemspec +26 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 03848c373f0f9d09c84176e957582d792c8b4d0d
|
4
|
+
data.tar.gz: 77b7640ca51cdc70bd368b47ce6207ad4b2c1a47
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ab8772e93386c0a8ca4187e3307e45e3d88fe69f4a3fe0ad0bcb46fa566cd24c855aeb01c8e90ecccb69162544d9b0495f6f5746dc5612be71a25f8273d0dee9
|
7
|
+
data.tar.gz: 7315cbc762e08beed4d7067ac0f90f258cf5bc32a76c995b74b39c04cc61b9615d69564242e066054e7269a22cc56e37e5633f556030a07e210c93d9234e0128
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 bash0C7
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Wangiry
|
2
|
+
|
3
|
+
call telephone and cancel after several seconds(say WAN GIRI in Japan)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'wangiry'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install wangiry
|
18
|
+
|
19
|
+
### get Twilio account
|
20
|
+
|
21
|
+
http://kddi-web.twilio.jp/ (Japanese)
|
22
|
+
|
23
|
+
### write setting file
|
24
|
+
|
25
|
+
setting file(json file) save your favolite path!
|
26
|
+
|
27
|
+
````js
|
28
|
+
{
|
29
|
+
"ACCOUNT_SID": "xxxx",
|
30
|
+
"AUTH_TOKEN": "xxxx",
|
31
|
+
"FROM_NUMBER": "+xxx",
|
32
|
+
"TO_NUMBER": "+xxxx",
|
33
|
+
"URL": "http://example.com",
|
34
|
+
"CALLING_TIME": x
|
35
|
+
}
|
36
|
+
````
|
37
|
+
|
38
|
+
- Twilio's account info: ACCOUNT_SID, AUTH_TOKEN
|
39
|
+
- Twilio's telephone number: FROM_NUMBER
|
40
|
+
- call number: TO_NUMBER
|
41
|
+
- some URL(RECOMMEND: your website): URL
|
42
|
+
- calling time(sec): CALLING_TIME
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
|
46
|
+
````sh
|
47
|
+
wangiry SETTING_FILE
|
48
|
+
````
|
49
|
+
|
50
|
+
ARGV.first: your setting file
|
51
|
+
|
52
|
+
## Contributing
|
53
|
+
|
54
|
+
1. Fork it
|
55
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
56
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
57
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
58
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/wangiry
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative '../lib/wangiry'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
if ARGV.size.zero?
|
6
|
+
STDERR.puts "usage: #{__FILE__} SETTING_FILE"
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
setting = JSON.parse(File.read(ARGV.shift))
|
11
|
+
Wangiry.call setting['ACCOUNT_SID'], setting['AUTH_TOKEN'], setting['FROM_NUMBER'], setting['TO_NUMBER'], setting['URL'], setting['CALLING_TIME']
|
12
|
+
|
data/lib/wangiry.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'twilio-ruby'
|
2
|
+
require "wangiry/version"
|
3
|
+
|
4
|
+
module Wangiry
|
5
|
+
def self.call account_sid, auth_token, from_number, to_number, url, calling_time
|
6
|
+
calling_time ||= 8
|
7
|
+
|
8
|
+
client = Twilio::REST::Client.new(account_sid, auth_token)
|
9
|
+
account = client.account
|
10
|
+
call = account.calls.create({:from => from_number, :to => to_number, :url => url})
|
11
|
+
#cancel if over calling_time
|
12
|
+
call.tap {|t| sleep(calling_time)}.cancel
|
13
|
+
end
|
14
|
+
end
|
data/wangiry.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'wangiry/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "wangiry"
|
8
|
+
spec.version = Wangiry::VERSION
|
9
|
+
spec.authors = ["bash0C7"]
|
10
|
+
spec.email = ["koshiba+github@4038nullpointer.com"]
|
11
|
+
spec.description = 'call telephone and cancel after several seconds(say WAN GIRI in Japan)'
|
12
|
+
spec.summary = 'call functon using Twilio'
|
13
|
+
spec.homepage = "http://d.hatena.ne.jp/bash0C7"
|
14
|
+
spec.license = "Ruby's"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "twilio-ruby"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "pry"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wangiry
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bash0C7
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: twilio-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: call telephone and cancel after several seconds(say WAN GIRI in Japan)
|
70
|
+
email:
|
71
|
+
- koshiba+github@4038nullpointer.com
|
72
|
+
executables:
|
73
|
+
- wangiry
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/wangiry
|
83
|
+
- lib/wangiry.rb
|
84
|
+
- lib/wangiry/version.rb
|
85
|
+
- wangiry.gemspec
|
86
|
+
homepage: http://d.hatena.ne.jp/bash0C7
|
87
|
+
licenses:
|
88
|
+
- Ruby's
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.0.0
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: call functon using Twilio
|
110
|
+
test_files: []
|