bungie_client 1.1.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
-
3
- require 'bungie_client'
4
-
5
- # init client
6
- @user = BungieClient::Wrappers::User.new(
7
- :api_key => 'YOUR_API_KEY',
8
- :display_name => 'RuBAN-GT',
9
- :membership_type => '2'
10
- )
11
-
12
- p @user.get_bungie_account.keys
data/services_parser.rb DELETED
@@ -1,33 +0,0 @@
1
- # This script can parse the list of bungie services from *destinydevs.github.io* for client.
2
-
3
- require 'yaml'
4
- require 'hashie'
5
- require 'mechanize'
6
- require 'underscore'
7
-
8
- # preset
9
- client = Mechanize.new
10
- url = 'http://destinydevs.github.io/BungieNetPlatform/docs/Endpoints'
11
- services = {}
12
-
13
- # get services
14
- client.get url do |page|
15
- trs = page.parser.search '.container .table tbody tr'
16
-
17
- trs.each do |tr|
18
- tds = tr.search 'td'
19
-
20
- next if tds.nil? || tds[1].nil?
21
-
22
- services[tds[1].text.underscore] = {
23
- :name => tds[1].text,
24
- :method => (tds[0]&.text.downcase || 'get'),
25
- :endpoint => (tds[2]&.text || '')
26
- }
27
- end unless trs.nil?
28
- end
29
-
30
- # save yaml
31
- File.open "#{File.dirname(__FILE__)}/lib/bungie_client/services.yml", 'w' do |f|
32
- f.write services.to_yaml
33
- end