buddy_liamog 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/buddy_liamog.rb +80 -0
- metadata +72 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OWRjMWM0NTczNWUyNTlkYjFhYzk0NWI5NTU4ZGVjZDJmOGEwYTZhZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZmVkYzEzOGM2NzE1NDI2YWU3ODNhNTJlNjBhNWI0MTk3MGM0ZDE1NA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTRjNjVjYjhiMDczNDcxMWYyMmIzZmVjNjA5OWIzZWQxODU1ZjRkZjY1MGEw
|
10
|
+
MDFhYjgzYjNhNjE3OWI5M2M4Nzk2NzI1ZjJlZWFkNGMxODViOWI1NzJiZjZm
|
11
|
+
MWZkMGQyNjM3MDA3MzJlMjQxMzIwNGMwZjZjYWYwOGU5OGU4MDE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODk1ZTk0OTQyMzEyMjQzODgwZWMxMzA5ZTRlZmExNDg3MWM0ZGM2ZWFhODVh
|
14
|
+
ZTcxMTc4NzgyNDBkYmQ1YmMyMWQ1OGIwYzc1ZDNiZjhlODgzZTE5NGU2ZmNk
|
15
|
+
N2Y5M2JiMzkwNGNlMjA5YmQzMmIwZDRkOGNlMjIyMmY0MmVjNjI=
|
data/lib/buddy_liamog.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module BuddyLiamog
|
4
|
+
VERSION = '0.0.1'
|
5
|
+
@config = {
|
6
|
+
:applicationName => '',
|
7
|
+
:applicationPass => ''
|
8
|
+
}
|
9
|
+
|
10
|
+
@valid_config_keys = @config.keys
|
11
|
+
|
12
|
+
def self.config
|
13
|
+
@config
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.set_config(application_name, application_pass)
|
17
|
+
@config[:applicationName] = application_name
|
18
|
+
@config[:applicationPass] = application_pass
|
19
|
+
end
|
20
|
+
|
21
|
+
# To change this template use File | Settings | File Templates.
|
22
|
+
|
23
|
+
def self.useraccount_profile_create(new_username, user_supplied_password, new_user_gender, user_age, new_user_email, status_id)
|
24
|
+
require 'net/https'
|
25
|
+
#https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?
|
26
|
+
# UserAccount_Profile_Create
|
27
|
+
# &BuddyApplicationName=EII_Application
|
28
|
+
# &BuddyApplicationPassword=2D5A783F-1CA2-4464-8EF0-4C0AB5279410
|
29
|
+
# &NewUserName=BuddyTester3
|
30
|
+
# &UserSuppliedPassword=testerpw3
|
31
|
+
# &NewUserGender=male
|
32
|
+
# &UserAge=21
|
33
|
+
# &NewUserEmail=tester2@test.com
|
34
|
+
# &StatusID=1
|
35
|
+
# &FuzzLocationEnabled=1
|
36
|
+
# &CelebModeEnabled=1
|
37
|
+
# &ApplicationTag=&RESERVED=
|
38
|
+
uri = URI.parse(URI.escape('https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?UserAccount_Profile_Create&BuddyApplicationName='+@config[:applicationName]+'&BuddyApplicationPassword='+@config[:applicationPass]+'&NewUserName='+new_username+'&UserSuppliedPassword='+user_supplied_password+'&NewUserGender='+new_user_gender+'&UserAge='+user_age+'&NewUserEmail='+new_user_email+'&StatusID='+status_id+'&ApplicationTag=&RESERVED='))
|
39
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
40
|
+
http.use_ssl = true
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
43
|
+
response = http.request(request)
|
44
|
+
return response.body
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.messages_message_send(user_token, message_string, to_user_id)
|
48
|
+
require 'net/https'
|
49
|
+
|
50
|
+
# https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?
|
51
|
+
# Messages_Message_Send
|
52
|
+
# &BuddyApplicationName=<appName>
|
53
|
+
# &BuddyApplicationPassword=<appPassword>
|
54
|
+
# &UserToken=<userToken>
|
55
|
+
# &MessageString=<messageString>
|
56
|
+
# &ToUserID=<toUserID>
|
57
|
+
# &ApplicationTag=<applicationTag> OPTIONAL
|
58
|
+
# &RESERVED= OPTIONAL
|
59
|
+
|
60
|
+
uri = URI.parse(URI.escape('https://webservice.buddyplatform.com/Service/v1/BuddyService.ashx?Messages_Message_Send&BuddyApplicationName='+@config[:applicationName]+'&BuddyApplicationPassword='+@config[:applicationPass]+'&UserToken='+user_token+'&MessageString='+message_string+'&ToUserID='+to_user_id.to_s))
|
61
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
62
|
+
http.use_ssl = true
|
63
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
64
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
65
|
+
response = http.request(request)
|
66
|
+
return response.body
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.messages_message_get(user_token)
|
70
|
+
require 'net/https'
|
71
|
+
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))
|
72
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
73
|
+
http.use_ssl = true
|
74
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
75
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
76
|
+
response = http.request(request)
|
77
|
+
return response.body
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: buddy_liamog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Liam Mycroft
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-04 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: Gem to provide integration with the buddy social platform
|
42
|
+
email: liamog@live.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/buddy_liamog.rb
|
48
|
+
homepage: ''
|
49
|
+
licenses:
|
50
|
+
- MIT
|
51
|
+
metadata: {}
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 2.0.3
|
69
|
+
signing_key:
|
70
|
+
specification_version: 4
|
71
|
+
summary: Implements profile creation and message send/get functions
|
72
|
+
test_files: []
|