threesixtyvoice 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmVjNTIxODM1YmRmNjdmMGNhNjVkYzQ2MmMxMGFmZTA3ZmM5NTg2YQ==
5
+ data.tar.gz: !binary |-
6
+ NjEyMjdjYTI0ZWUxMDdmODAyZDE0MjRlMjM3MzVlNDAyODA4NzEwYw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Nzg0ZWM5ODY5M2RmN2JmZjE1NjUwYzZmNTcxNmU3YTE5ZGNiMzliNDQ0M2Vl
10
+ ZTQ2ZTBjOTY4ZTkwOThlNzE5M2M5ODU3MWU4ZTUwN2I2ZDllOWM5ZDQ0ZWJk
11
+ Yjg0NjZmN2ZlNTBmNTYxN2MxYWVjOTRkY2YyZTMyMGU0MDVkZjI=
12
+ data.tar.gz: !binary |-
13
+ YjNjMTJlYWQwZjEyNTQ4ZmFiOTQwMWYxZjYxOGNkZmRkZTM4MjFmOGI2NzIw
14
+ NWYyM2UyZDQ1ODU3YWJhNzVlYTE5NTQ2NzU0MzVlNTM5YWY2YmZjYzE2OGY2
15
+ MTBhYjI1NDhhY2Y1ZTcwNjU1Mzk3MzMxZDk2NWU2ZWE0ZmFlYTg=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in threesixtyvoice.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 David Larrabee
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,84 @@
1
+ # Threesixtyvoice
2
+ ================================
3
+
4
+ A gem that wraps the 360voice API
5
+ http://360voice.gamerdna.com/forum/topic.asp?TOPIC_ID=3
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'threesixtyvoice'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install threesixtyvoice
20
+
21
+ ## Usage
22
+
23
+ ### Badgelist
24
+ -------------------------
25
+ Params: None
26
+
27
+ ```ruby
28
+ badgelist = Threesixtyvoice.badge_list
29
+ puts badgelist.version
30
+ puts badgelist.title
31
+ puts badgelist.owners
32
+ badgelist.badges.each { |badge| puts badge.title }
33
+ ```
34
+
35
+ ### BadgetListGamertags
36
+ -------------------------
37
+ #### Params
38
+ * id [required]: the badge id
39
+
40
+ ```ruby
41
+ list = Threesixtyvoice.bage_list_gamertags(32)
42
+ puts list.version
43
+ puts list.title
44
+ puts list.id
45
+ puts list.count
46
+ list.owners.each { |owner| puts owner }
47
+ ```
48
+
49
+ ### BlogGetentries -TBD
50
+ ### BlogLatest -TBD
51
+ ### ChallengeStats -TBD
52
+ ### ChallengeViral -TBD
53
+ ### ChallengeVitals -TBD
54
+ ### ChallengeDetails -TBD
55
+ ### Jobs -TBD
56
+ ### Leaderboards -TBD
57
+ ### GamesList -TBD
58
+ ### GamesListFav -TBD
59
+ ### GamesShowTiles -TBD
60
+ ### GamesShowTilesHtml -TBD
61
+ ### GamertagGroups -TBD
62
+ ### CollectionLists -TBD
63
+ ### CollectionGamesList -TBD
64
+ ### CollectionHistory -TBD
65
+ ### GamertagBadges -TBD
66
+ ### GamertagExists -TBD
67
+ ### GamertagAuthenticate -TBD
68
+ ### GamertagLeader -TBD
69
+ ### GamertagProfile -TBD
70
+ ### GamertagWatchlist -TBD
71
+ ### GenresList -TBD
72
+ ### Popular -TBD
73
+ ### ScoreGetList -TBD
74
+ ### GroupsProfile -TBD
75
+ ### GroupsMembers -TBD
76
+
77
+
78
+ ## Contributing
79
+
80
+ 1. Fork it
81
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
82
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
83
+ 4. Push to the branch (`git push origin my-new-feature`)
84
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,6 @@
1
+ module Threesixtyvoice
2
+ class Badge < Struct.new("Badge",:id, :title, :owners, :imae, :description,
3
+ :category, :category_id, :threshold, :categoryname,
4
+ :badgescore_old, :badgescore, :badgescorecount)
5
+ end
6
+ end
@@ -0,0 +1,20 @@
1
+ module Threesixtyvoice
2
+ class BadgeList
3
+ attr_reader :version, :title, :badges
4
+
5
+ def initialize(doc)
6
+ @version = doc.xpath('//api/info/version').text
7
+ @title = doc.xpath('//api/info/title').text
8
+
9
+ @badges = doc.xpath('//api/badges/badge').map do |i|
10
+ Badge.new(i.xpath('id').text, i.xpath('title').text,
11
+ i.xpath('owners').text, i.xpath('image').text,
12
+ i.xpath('description').text, i.xpath("category").text,
13
+ i.xpath("category_id").text, i.xpath('threshold').text,
14
+ i.xpath('categoryname').text, i.xpath('badgescore_old').text,
15
+ i.xpath('badgescore').text, i.xpath('badgescorecount').text
16
+ )
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ module Threesixtyvoice
2
+
3
+ class BadgesListGamertags
4
+ attr_reader :version, :title, :id, :count, :owners
5
+
6
+ def initialize(doc)
7
+
8
+ @version = doc.xpath('//api/info/version').text
9
+ @title = doc.xpath('//api/info/title').text
10
+ @count = doc.xpath('//api/info/count').text
11
+ @id = doc.xpath('//api/info/id').text
12
+
13
+ @owners = doc.xpath('//api/owners/owner').map { |i| i.text }
14
+
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module Threesixtyvoice
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,30 @@
1
+ require "threesixtyvoice/version"
2
+ require 'net/http'
3
+ require 'nokogiri'
4
+
5
+ module Threesixtyvoice
6
+
7
+ def self.badges_list_gamertags(badge_id)
8
+ doc = get_xml_doc("/api/badges-list-gamertags.asp?id=#{badge_id}")
9
+ BadgesListGamertags.new(doc)
10
+ end
11
+
12
+ def self.badge_list
13
+ doc = get_xml_doc("/api/badges-list.asp")
14
+ BadgeList.new(doc)
15
+ end
16
+
17
+ private
18
+
19
+ def get_xml_doc(api_path)
20
+ uri = URI.parse("http://360voice.gamerdna.com")
21
+ http = Net::HTTP.new(uri.host, uri.port)
22
+ response = http.get(api_path).body
23
+ Nokogiri::XML(response)
24
+ end
25
+
26
+ end
27
+
28
+ require "threesixtyvoice/badge"
29
+ require "threesixtyvoice/badge_list"
30
+ require "threesixtyvoice/badges_list_gamertags"
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/threesixtyvoice')
5
+
6
+ class ThreesixtyvoiceTest < Test::Unit::TestCase
7
+ include Threesixtyvoice
8
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'threesixtyvoice/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "threesixtyvoice"
8
+ spec.version = Threesixtyvoice::VERSION
9
+ spec.authors = ["David Larrabee"]
10
+ spec.email = ["david.larrabee@meyouhealth.com"]
11
+ spec.description = %q{A gem to interacte with the 360voice API}
12
+ spec.summary = %q{Wrapper for the 360voice API}
13
+ spec.homepage = "https://github.com/dlarrabee/threesixtyvoice"
14
+ spec.license = "MIT"
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_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: threesixtyvoice
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - David Larrabee
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A gem to interacte with the 360voice API
42
+ email:
43
+ - david.larrabee@meyouhealth.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/threesixtyvoice.rb
54
+ - lib/threesixtyvoice/badge.rb
55
+ - lib/threesixtyvoice/badge_list.rb
56
+ - lib/threesixtyvoice/badges_list_gamertags.rb
57
+ - lib/threesixtyvoice/version.rb
58
+ - test/threesixtyvoice_test.rb
59
+ - threesixtyvoice.gemspec
60
+ homepage: https://github.com/dlarrabee/threesixtyvoice
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.0.3
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Wrapper for the 360voice API
84
+ test_files:
85
+ - test/threesixtyvoice_test.rb