buddy_liamog 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/buddy_liamog.rb +22 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2RiM2JhZGRmZjBmNmVjZjcxYzIxMDlmNTBkZDljMDE3YzRkZTcxZA==
4
+ MmJmY2U2OWNlNzJlMTIxZjBiNmY3ODdkNDFlYTNlYzZmZGM0NzY3Mg==
5
5
  data.tar.gz: !binary |-
6
- MDdlNGJkNzBjZWExMzE4ZWRjZDU2ODQxMGZkNjhjYjRjOWFhMmNhOA==
6
+ NmMwMzIyNjg2MGU1ODFlZDc3Y2RiMWUwMjhkOWJkMjgxYWRjZjJhNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTI2MzQyNTAxNGIzYWMxMjgzNzA3ZDg3YjRmODhjZDViNmRmZjRhZjNhNGIy
10
- ODA0NGM1M2UyOTE0MDg5MDVjYTYxOTVlMjY2NWVlZTE3MDA4YTgwZDgyZDI1
11
- N2VlMTMyZWQ3ODBlNzBjZjg2ZTVhNGVkNDRjYTVkMTM3ZTQ1NjQ=
9
+ OWI1ZmJiMDk3YjU0YzVmOWFhNTcwN2NlMzlmMmFhMzNmN2M4Nzg3YzJiZGRi
10
+ MjAxZjJiMDAzMDNmNDNjYjYxNGRlNjRhNWQ1MmIwZWU2NWRjNzUyNDVjMTgx
11
+ ZWUwM2U4ZWRjYjkwOGY3YzA4ZmYwMTllYjhiODU0MjJjMWMwZGQ=
12
12
  data.tar.gz: !binary |-
13
- MTQwMDY4MDYyNmFjNGI4ZTNjZTJmYzU5ZTNjNjkxODMxODFlZmEzNDIzYzM1
14
- NGEyYjE0ZmZiNzJiZWRiZTgyMDVmYzg1Y2FjNjM1NjgxODJkOGZkYWY2ZTU4
15
- NzYzZDZkYWIwYTk0YjM1YWJiMDU2NDFhMjNlNjc0ZWRlOTgwZmU=
13
+ YzFjM2FmMjRiNzM3ZDY5NTkzMDgyYThjNDhlNTdmNGQ2YTUyMWI2OGFmZDRh
14
+ MTczMzFkNWYxYjAxMDlkY2MxM2I0YmUyZDNiYWJmNDcwOWQwYmQ0MDU0OGZj
15
+ MDkwMmEwMTYxZDU4YmM1NjA0YmMxM2FkNjI2NzAwZTMzZTMyOWM=
data/lib/buddy_liamog.rb CHANGED
@@ -1,7 +1,19 @@
1
+ # This program provides Ruby shims for the HTTP calls
2
+ # to the Buddy Platform
3
+ #
4
+ # More info on the requirements for each method can be found at http://buddy.com/documentation.aspx
5
+ #
6
+ # Author:: Liam Mycroft
7
+ # Copyright:: Copyright (c) 2013 Liam Mycroft, a Human
8
+ # License:: MIT
9
+
1
10
  require 'yaml'
2
11
 
12
+ # This program provides Ruby shims for the HTTP calls
13
+ # to the Buddy Platform
3
14
  module BuddyLiamog
4
- VERSION = '0.0.1'
15
+
16
+ # Configuration Holder
5
17
  @config = {
6
18
  :applicationName => '',
7
19
  :applicationPass => ''
@@ -9,17 +21,18 @@ module BuddyLiamog
9
21
 
10
22
  @valid_config_keys = @config.keys
11
23
 
24
+ # Blank configuration
12
25
  def self.config
13
26
  @config
14
27
  end
15
28
 
29
+ # Set the application config settings
16
30
  def self.set_config(application_name, application_pass)
17
31
  @config[:applicationName] = application_name
18
32
  @config[:applicationPass] = application_pass
19
33
  end
20
34
 
21
- # To change this template use File | Settings | File Templates.
22
-
35
+ # Create a user account
23
36
  def self.useraccount_profile_create(new_username, user_supplied_password, new_user_gender, user_age, new_user_email, status_id)
24
37
  require 'net/https'
25
38
  #https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?
@@ -44,6 +57,7 @@ module BuddyLiamog
44
57
  return response.body
45
58
  end
46
59
 
60
+ # Send a message from user token to user_id
47
61
  def self.messages_message_send(user_token, message_string, to_user_id)
48
62
  require 'net/https'
49
63
 
@@ -66,6 +80,7 @@ module BuddyLiamog
66
80
  return response.body
67
81
  end
68
82
 
83
+ # Get messages for user with user_token
69
84
  def self.messages_message_get(user_token)
70
85
  require 'net/https'
71
86
  uri = URI.parse(URI.escape('https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?Messages_Messages_Get&BuddyApplicationName='+@config[:applicationName]+'&BuddyApplicationPassword='+@config[:applicationPass]+'&UserToken='+user_token))
@@ -77,6 +92,7 @@ module BuddyLiamog
77
92
  return response.body
78
93
  end
79
94
 
95
+ # Set application level metadata
80
96
  def self.metadata_application_meta_data_value_set(socket_meta_key,socket_meta_value, meta_latitude, meta_longitude)
81
97
  require 'net/https'
82
98
  uri = URI.parse(URI.escape('https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?MetaData_ApplicationMetaDataValue_Set&BuddyApplicationName='+@config[:applicationName]+'&BuddyApplicationPassword='+@config[:applicationPass]+'&SocketMetaKey='+socket_meta_key+'&SocketMetaValue='+socket_meta_value+'&MetaLatitude='+meta_latitude+'&MetaLongitude='+meta_longitude))
@@ -87,12 +103,14 @@ module BuddyLiamog
87
103
  response = http.request(request)
88
104
  return response.body
89
105
  end
106
+
107
+ # Get application level metadata
90
108
  def self.metadata_application_meta_data_value_get(socket_meta_key)
91
109
  require 'net/https'
92
110
  uri = URI.parse(URI.escape('https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?MetaData_ApplicationMetaDataValue_Get&BuddyApplicationName='+@config[:applicationName]+'&BuddyApplicationPassword='+@config[:applicationPass]+'&SocketMetaKey='+socket_meta_key))
93
111
  http = Net::HTTP.new(uri.host, uri.port)
94
112
  http.use_ssl = true
95
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
113
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE crd
96
114
  request = Net::HTTP::Get.new(uri.request_uri)
97
115
  response = http.request(request)
98
116
  return response.body
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buddy_liamog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam Mycroft