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.
- checksums.yaml +8 -8
- data/lib/buddy_liamog.rb +22 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmJmY2U2OWNlNzJlMTIxZjBiNmY3ODdkNDFlYTNlYzZmZGM0NzY3Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmMwMzIyNjg2MGU1ODFlZDc3Y2RiMWUwMjhkOWJkMjgxYWRjZjJhNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWI1ZmJiMDk3YjU0YzVmOWFhNTcwN2NlMzlmMmFhMzNmN2M4Nzg3YzJiZGRi
|
10
|
+
MjAxZjJiMDAzMDNmNDNjYjYxNGRlNjRhNWQ1MmIwZWU2NWRjNzUyNDVjMTgx
|
11
|
+
ZWUwM2U4ZWRjYjkwOGY3YzA4ZmYwMTllYjhiODU0MjJjMWMwZGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
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
|
-
#
|
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
|