Stands4 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +73 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +23 -0
- data/LICENSE.txt +22 -0
- data/README.md +55 -0
- data/Rakefile +2 -0
- data/Stands4.gemspec +24 -0
- data/Stands4.sublime-project +9 -0
- data/examples/stands4_examples.rb +27 -0
- data/lib/Stands4.rb +77 -0
- data/lib/Stands4/version.rb +3 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2ee1bd571e74bf0cf63ddec210ba724a903c7ebd
|
4
|
+
data.tar.gz: 5c5e8abf0a19831a53d7628ae8412af08a7b30da
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d92fc9bf81171bcb3584fe180965ec8482a4ebf38ecb3f667e72c4398e013857a942d6ffe327c64ecb5fbee429f58b7c5c71dfbd6b5514f6161ec3bc5e8d1caf
|
7
|
+
data.tar.gz: 793683029c55e2c500d04b3004b739e22043491edf3d030a3e26a51543b2a47bb0dcff25475fe94419fba0c52902a81133c160513ce001e10ea5402729f28ec0
|
data/.gitignore
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Created by http://www.gitignore.io
|
2
|
+
|
3
|
+
### OSX ###
|
4
|
+
.DS_Store
|
5
|
+
.AppleDouble
|
6
|
+
.LSOverride
|
7
|
+
|
8
|
+
# Icon must end with two \r
|
9
|
+
Icon
|
10
|
+
|
11
|
+
|
12
|
+
# Thumbnails
|
13
|
+
._*
|
14
|
+
|
15
|
+
# Files that might appear on external disk
|
16
|
+
.Spotlight-V100
|
17
|
+
.Trashes
|
18
|
+
|
19
|
+
# Directories potentially created on remote AFP share
|
20
|
+
.AppleDB
|
21
|
+
.AppleDesktop
|
22
|
+
Network Trash Folder
|
23
|
+
Temporary Items
|
24
|
+
.apdisk
|
25
|
+
|
26
|
+
|
27
|
+
### SublimeText ###
|
28
|
+
# workspace files are user-specific
|
29
|
+
*.sublime-workspace
|
30
|
+
|
31
|
+
# project files should be checked into the repository, unless a significant
|
32
|
+
# proportion of contributors will probably not be using SublimeText
|
33
|
+
# *.sublime-project
|
34
|
+
|
35
|
+
#sftp configuration file
|
36
|
+
sftp-config.json
|
37
|
+
|
38
|
+
|
39
|
+
### Ruby ###
|
40
|
+
*.gem
|
41
|
+
*.rbc
|
42
|
+
/.config
|
43
|
+
/coverage/
|
44
|
+
/InstalledFiles
|
45
|
+
/pkg/
|
46
|
+
/spec/reports/
|
47
|
+
/test/tmp/
|
48
|
+
/test/version_tmp/
|
49
|
+
/tmp/
|
50
|
+
|
51
|
+
## Specific to RubyMotion:
|
52
|
+
.dat*
|
53
|
+
.repl_history
|
54
|
+
build/
|
55
|
+
|
56
|
+
## Documentation cache and generated files:
|
57
|
+
/.yardoc/
|
58
|
+
/_yardoc/
|
59
|
+
/doc/
|
60
|
+
/rdoc/
|
61
|
+
|
62
|
+
## Environment normalisation:
|
63
|
+
/.bundle/
|
64
|
+
/lib/bundler/man/
|
65
|
+
|
66
|
+
# for a library or gem, you might want to ignore these files since the code is
|
67
|
+
# intended to run in multiple environments; otherwise, check them in:
|
68
|
+
# Gemfile.lock
|
69
|
+
# .ruby-version
|
70
|
+
# .ruby-gemset
|
71
|
+
|
72
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
73
|
+
.rvmrc
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
Stands4 (1.0.0)
|
5
|
+
httparty
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
httparty (0.13.1)
|
11
|
+
json (~> 1.8)
|
12
|
+
multi_xml (>= 0.5.2)
|
13
|
+
json (1.8.1)
|
14
|
+
multi_xml (0.5.5)
|
15
|
+
rake (10.1.0)
|
16
|
+
|
17
|
+
PLATFORMS
|
18
|
+
ruby
|
19
|
+
|
20
|
+
DEPENDENCIES
|
21
|
+
Stands4!
|
22
|
+
bundler (~> 1.7)
|
23
|
+
rake (~> 10.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Dante Durrman
|
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,55 @@
|
|
1
|
+
# Stands4
|
2
|
+
|
3
|
+
A Ruby gem for accessing Stands4's API
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'Stands4'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ (sudo) gem install Stands4
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
require 'Stands4'
|
22
|
+
require 'pp'
|
23
|
+
|
24
|
+
include Stands4
|
25
|
+
Stands4.configure('YOUR_UID','YOUR_TOKENID')
|
26
|
+
|
27
|
+
abbreviations = Stands4.abbr('asap')
|
28
|
+
|
29
|
+
uszips = Stands4.zip('90210')
|
30
|
+
|
31
|
+
definitions = Stands4.defs('consistent')
|
32
|
+
|
33
|
+
rhymes = Stands4.rhymes('rhyme')
|
34
|
+
|
35
|
+
conversions = Stands4.conv('5 pounds to kilograms')
|
36
|
+
|
37
|
+
synonyms = Stands4.syno('consistent')
|
38
|
+
|
39
|
+
phrases = Stands4.phrases('buckle up')
|
40
|
+
|
41
|
+
quotes_random = Stands4.quotes
|
42
|
+
|
43
|
+
quotes_search = Stands4.quotes('The only real valuable thing is intuition.', 'SEARCH')
|
44
|
+
|
45
|
+
author_search = Stands4.quotes('Albert Einstein', 'AUTHOR')
|
46
|
+
|
47
|
+
pp abbreviations
|
48
|
+
|
49
|
+
## Contributing
|
50
|
+
|
51
|
+
1. Fork it ( https://github.com/dantedurrman/Stands4/fork )
|
52
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
53
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
54
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
55
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/Stands4.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'Stands4/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "Stands4"
|
8
|
+
spec.version = Stands4::VERSION
|
9
|
+
spec.authors = ["Dante Durrman"]
|
10
|
+
spec.email = ["mail@dante.codes"]
|
11
|
+
spec.summary = %q{A Ruby gem for accessing Stands4 API}
|
12
|
+
spec.homepage = "https://github.com/dantedurrman/Stands4"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency 'httparty'
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'stands4'
|
2
|
+
require 'pp'
|
3
|
+
|
4
|
+
include Stands4
|
5
|
+
Stands4.configure('YOUR_UID','YOUR_TOKENID')
|
6
|
+
|
7
|
+
abbreviations = Stands4.abbr('asap')
|
8
|
+
|
9
|
+
uszips = Stands4.zip('90210')
|
10
|
+
|
11
|
+
definitions = Stands4.defs('consistent')
|
12
|
+
|
13
|
+
rhymes = Stands4.rhymes('rhyme')
|
14
|
+
|
15
|
+
conversions = Stands4.conv('5 pounds to kilograms')
|
16
|
+
|
17
|
+
synonyms = Stands4.syno('consistent')
|
18
|
+
|
19
|
+
phrases = Stands4.phrases('buckle up')
|
20
|
+
|
21
|
+
quotes_random = Stands4.quotes
|
22
|
+
|
23
|
+
quotes_search = Stands4.quotes('The only real valuable thing is intuition.', 'SEARCH')
|
24
|
+
|
25
|
+
author_search = Stands4.quotes('Albert Einstein', 'AUTHOR')
|
26
|
+
|
27
|
+
pp abbreviations
|
data/lib/Stands4.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'Stands4/version'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
module Stands4
|
5
|
+
include HTTParty
|
6
|
+
base_uri 'stands4.com'
|
7
|
+
|
8
|
+
def self.configure(uid, tokenid)
|
9
|
+
@@uid = uid
|
10
|
+
@@tokenid = tokenid
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.abbr(term)
|
14
|
+
options = {
|
15
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
16
|
+
:term => term }
|
17
|
+
}
|
18
|
+
results = get('/services/v2/abbr.php', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.zip(zip)
|
22
|
+
options = {
|
23
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
24
|
+
:zip => zip }
|
25
|
+
}
|
26
|
+
results = get('/services/v2/zip.php', options)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.defs(word)
|
30
|
+
options = {
|
31
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
32
|
+
:word => word }
|
33
|
+
}
|
34
|
+
results = get('/services/v2/defs.php', options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.rhymes(term)
|
38
|
+
options = {
|
39
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
40
|
+
:term => term }
|
41
|
+
}
|
42
|
+
results = get('/services/v2/rhymes.php', options)
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.conv(expression)
|
46
|
+
options = {
|
47
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
48
|
+
:expression => expression }
|
49
|
+
}
|
50
|
+
results = get('/services/v2/conv.php', options)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.syno(word)
|
54
|
+
options = {
|
55
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
56
|
+
:word => word }
|
57
|
+
}
|
58
|
+
results = get('/services/v2/syno.php', options)
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.phrases(phrase)
|
62
|
+
options = {
|
63
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
64
|
+
:phrase => phrase }
|
65
|
+
}
|
66
|
+
results = get('/services/v2/phrases.php', options)
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.quotes(searchtype='RANDOM', query='')
|
70
|
+
options = {
|
71
|
+
:query => { :uid => @@uid, :tokenid => @@tokenid,
|
72
|
+
:searchtype => searchtype, :query => query, }
|
73
|
+
}
|
74
|
+
results = get('/services/v2/quotes.php', options)
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Stands4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dante Durrman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
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.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- mail@dante.codes
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- Gemfile.lock
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- Stands4.gemspec
|
69
|
+
- Stands4.sublime-project
|
70
|
+
- examples/stands4_examples.rb
|
71
|
+
- lib/Stands4.rb
|
72
|
+
- lib/Stands4/version.rb
|
73
|
+
homepage: https://github.com/dantedurrman/Stands4
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.2.2
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: A Ruby gem for accessing Stands4 API
|
97
|
+
test_files: []
|