rmobio 1.1.0
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.
- data/lib/rmobio/ads/ad_mobs.rb +83 -0
- data/lib/rmobio/ads/ad_sense.rb +190 -0
- data/lib/rmobio/ads/m_khoj.rb +54 -0
- data/lib/rmobio/ads/smaato.rb +106 -0
- data/lib/rmobio/ads.rb +24 -0
- data/lib/rmobio/auth.rb +155 -0
- data/lib/rmobio/cas.rb +24 -0
- data/lib/rmobio/client_info.rb +194 -0
- data/lib/rmobio/config_manager.rb +63 -0
- data/lib/rmobio/raketasks.rb +143 -0
- data/lib/rmobio/utils.rb +213 -0
- data/lib/rmobio/webservices/soap/drivers.rb +62 -0
- data/lib/rmobio/webservices/soap/geocode.rb +19 -0
- data/lib/rmobio/webservices/soap/messaging.rb +75 -0
- data/lib/rmobio/webservices/soap/platform.rb +21 -0
- data/lib/rmobio/webservices/soap/registration.rb +106 -0
- data/lib/rmobio/webservices/soap/rss.rb +49 -0
- data/lib/rmobio/webservices.rb +72 -0
- data/lib/rmobio.rb +22 -0
- metadata +84 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
#require 'drivers'
|
19
|
+
class Messaging < Mobio::WebServices::WsdlDriver
|
20
|
+
def send_email(to, from, subject, body)
|
21
|
+
begin
|
22
|
+
res = self.class.driver.sendEmail :toAddress => to, :fromAddress => from, :subject => subject, :body => body
|
23
|
+
unless res.result.xmlattr_nil == 'true'
|
24
|
+
false
|
25
|
+
else
|
26
|
+
true
|
27
|
+
end
|
28
|
+
rescue SOAP::FaultError
|
29
|
+
false
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_country_names
|
34
|
+
begin
|
35
|
+
res = self.class.driver.getCountryNames true #not sure if we need to pass it true...
|
36
|
+
res.countryNames.string
|
37
|
+
rescue SOAP::FaultError
|
38
|
+
false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_carriers_for_country(country)
|
43
|
+
begin
|
44
|
+
res = self.class.driver.getCarriersForCountry :countryName => country
|
45
|
+
if res.carrierNames.respond_to? :string
|
46
|
+
res.carrierNames.string
|
47
|
+
else
|
48
|
+
nil
|
49
|
+
end
|
50
|
+
rescue SOAP::FaultError
|
51
|
+
false
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def get_carrier_names
|
56
|
+
begin
|
57
|
+
res = self.class.driver.getCarrierNames
|
58
|
+
if res.carrierNames.respond_to? :string
|
59
|
+
res.carrierNames.string
|
60
|
+
else
|
61
|
+
nil
|
62
|
+
end
|
63
|
+
rescue SOAP::FaultError
|
64
|
+
false
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# to be finished
|
69
|
+
def bulk_sms
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.send_sms(countryName, phoneNumber, carrier, text, from)
|
73
|
+
res = self.driver.sendSMS :countryName => countryName, :phoneNumber => phoneNumber, :carrier => carrier, :text => text, :from => from
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
require 'drivers'
|
19
|
+
# this is for the MobioService, but calling it mobio creates a conflict
|
20
|
+
class Platform < Mobio::WebServices::WsdlDriver
|
21
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
class Registration < Mobio::WebServices::WsdlDriver
|
19
|
+
def self.create_passphrase
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get_handsets(loginId, password)
|
23
|
+
res = self.driver.getHandsets :loginId => loginId, :password => password
|
24
|
+
res.out
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.get_security_question(loginId)
|
28
|
+
res = self.driver.getSecurityQuestion :loginId => loginId
|
29
|
+
res.out
|
30
|
+
end
|
31
|
+
|
32
|
+
#can throw SOAP::FaultError if login / password is invalid
|
33
|
+
def self.get_user_info(loginId, password)
|
34
|
+
res = self.driver.getUserInfo :loginId => loginId, :password => password
|
35
|
+
res.out
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.is_login_id_available(loginId)
|
39
|
+
res = self.driver.isLoginIdAvailable :loginId => loginId
|
40
|
+
res.out
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.list_affiliations
|
44
|
+
res = self.driver.listAffiliations ""
|
45
|
+
res.out
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.register_handset(loginId,password,handset)
|
49
|
+
res = self.driver.registerHandset :userLogin => loginId,:userPassword => password,:handset => handset
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.register_user(args={})
|
54
|
+
regIn= RegisterIn.new
|
55
|
+
args.each do |key, value|
|
56
|
+
if regIn.respond_to?(key)
|
57
|
+
regIn.send "#{key}=", value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
res = self.driver.registerUser :registerIn => regIn
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.unregister_handset(login,password,handsetId)
|
64
|
+
res = self.driver.unregisterHandset :userLogin => login,:userPassword=>password,:handsetId=>handsetId
|
65
|
+
res.out
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.update_login_info(arg)
|
69
|
+
res = self.driver.updateLoginInfo :loginUpdate => arg
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.update_user_info(user)
|
73
|
+
res = self.driver.updateUserInfo :userInfo => user
|
74
|
+
res.out
|
75
|
+
end
|
76
|
+
class RegisterIn
|
77
|
+
attr_accessor :givenName, :familyName, :carrier, :communicationViaEmail,
|
78
|
+
:communicationViaSMS, :dateOfBirthMonth, :dateOfBirthYear,
|
79
|
+
:dateOfBirthDate, :emailAddress, :gender, :primaryRefCode,
|
80
|
+
:secondaryRefCode, :phoneModel, :phoneNumber, :zipCode,
|
81
|
+
:loginId, :registrationID, :mor, :password
|
82
|
+
|
83
|
+
def initialize()
|
84
|
+
@registrationID = ''
|
85
|
+
@givenName = ''
|
86
|
+
@familyName = ''
|
87
|
+
@carrier = ''
|
88
|
+
@communicationViaEmail = false
|
89
|
+
@communicationViaSMS = true
|
90
|
+
@dateOfBirthMonth = ''
|
91
|
+
@dateOfBirthYear = ''
|
92
|
+
@dateOfBirthDate = ''
|
93
|
+
@emailAddress = ''
|
94
|
+
@gender = ''
|
95
|
+
@primaryRefCode = ''
|
96
|
+
@secondaryRefCode = ''
|
97
|
+
@phoneModel = ''
|
98
|
+
@phoneNumber = ''
|
99
|
+
@zipCode = ''
|
100
|
+
@loginId = ''
|
101
|
+
@password = ''
|
102
|
+
@mor = false
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
require 'drivers'
|
19
|
+
class Rss < Mobio::WebServices::WsdlDriver
|
20
|
+
# returns a nil object if nothing can be found
|
21
|
+
def item(itemid)
|
22
|
+
self.class.driver.item(itemid)
|
23
|
+
end
|
24
|
+
|
25
|
+
# returns a nil object if nothing can be found
|
26
|
+
def prepare(feed_url = '', feed_label = '')
|
27
|
+
self.class.driver.prepare(feed_url, feed_label)
|
28
|
+
end
|
29
|
+
|
30
|
+
# returns a summary or nil object if it can't do anything
|
31
|
+
def summary(feed_url = '', feed_label = '')
|
32
|
+
self.class.driver.summary(feed_url, feed_label)
|
33
|
+
end
|
34
|
+
|
35
|
+
# returns a nil object if nothing can be found
|
36
|
+
def view(feed_url = '', feed_label = '', num_items = 10, descrip_size = 100, descrip_strip = '', other = '')
|
37
|
+
self.class.driver.view(feed_url, feed_label, num_items, descrip_size, descrip_strip, other)
|
38
|
+
end
|
39
|
+
|
40
|
+
# this doesn't work right now 7/2/07
|
41
|
+
def item_description(itemid)
|
42
|
+
self.class.driver.itemDescription(itemid)
|
43
|
+
end
|
44
|
+
|
45
|
+
# this doesn't work right now 7/2/07
|
46
|
+
def item_link_content(itemid)
|
47
|
+
self.class.driver.itemLinkcontent(itemid)
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
# WSDL address for any wsdl based service
|
19
|
+
|
20
|
+
module Rmobio
|
21
|
+
module WebServices
|
22
|
+
module Wsdl
|
23
|
+
|
24
|
+
###
|
25
|
+
# This helps in intializing the WSDL based services one at a time.
|
26
|
+
# It loads the service using the appropriate WSDL file, and retries
|
27
|
+
# a default of 5 times if the service cannot be launched before failing.
|
28
|
+
#
|
29
|
+
# :service is the service to be instantiated, for example 'registration'
|
30
|
+
# it should be associated with an equivalent WSDL file and constant like
|
31
|
+
# REGISTRATION_WSDL.
|
32
|
+
#
|
33
|
+
# :silent, default = false; This either throws an error if the service cannot
|
34
|
+
# load or allows the service to silently fail if the service cannot be instantiated
|
35
|
+
# correctly.
|
36
|
+
#
|
37
|
+
# usage
|
38
|
+
# Rmobio::Webservices::Wsdl::include('registration')
|
39
|
+
#
|
40
|
+
# Rmobio::Webservices::Wsdl::include('messaging', true) # this will fail silently if the
|
41
|
+
# service cannot be instantiated
|
42
|
+
###
|
43
|
+
def self.include(service, silent = false, param_wsdl=nil)
|
44
|
+
begin
|
45
|
+
require File.dirname(__FILE__) + '/webservices/soap/drivers'
|
46
|
+
require File.dirname(__FILE__) + '/webservices/soap/' + service.downcase
|
47
|
+
|
48
|
+
# added because this error was being observed:
|
49
|
+
# /opt/local/lib/ruby/1.8/soap/wsdlDriver.rb:62:in `find_port':NoMethodError: undefined method `services' for #<WSDL::XMLSchema::Schema:0x1a41b80>
|
50
|
+
# unsure what it does, but this retry sequence seems to load things properly
|
51
|
+
tries = 0
|
52
|
+
begin
|
53
|
+
Module.const_get(service.downcase.capitalize).wsdl= param_wsdl
|
54
|
+
rescue NoMethodError
|
55
|
+
tries += 1
|
56
|
+
p tries
|
57
|
+
retry unless tries > 5
|
58
|
+
end
|
59
|
+
# end retry
|
60
|
+
|
61
|
+
rescue LoadError # no file to load
|
62
|
+
raise $! unless silent
|
63
|
+
return false
|
64
|
+
rescue NameError # no constant
|
65
|
+
raise $! unless silent
|
66
|
+
return false
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
data/lib/rmobio.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2007 Mobio Networks, Inc.
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
#
|
17
|
+
|
18
|
+
# Require the main files in the library
|
19
|
+
require 'rmobio/client_info'
|
20
|
+
require 'rmobio/utils'
|
21
|
+
require 'rmobio/webservices'
|
22
|
+
require 'rmobio/mobioraketasks'
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rmobio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Blum
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-03-13 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hpricot
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0.6"
|
23
|
+
version:
|
24
|
+
description: ""
|
25
|
+
email: a@getmobio.com
|
26
|
+
executables: []
|
27
|
+
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files: []
|
31
|
+
|
32
|
+
files:
|
33
|
+
- lib/rmobio.rb
|
34
|
+
- lib/rmobio
|
35
|
+
- lib/rmobio/webservices.rb
|
36
|
+
- lib/rmobio/ads.rb
|
37
|
+
- lib/rmobio/utils.rb
|
38
|
+
- lib/rmobio/webservices
|
39
|
+
- lib/rmobio/auth.rb
|
40
|
+
- lib/rmobio/ads
|
41
|
+
- lib/rmobio/cas.rb
|
42
|
+
- lib/rmobio/config_manager.rb
|
43
|
+
- lib/rmobio/raketasks.rb
|
44
|
+
- lib/rmobio/client_info.rb
|
45
|
+
- lib/rmobio/webservices/rest
|
46
|
+
- lib/rmobio/webservices/soap
|
47
|
+
- lib/rmobio/webservices/soap/registration.rb
|
48
|
+
- lib/rmobio/webservices/soap/rss.rb
|
49
|
+
- lib/rmobio/webservices/soap/drivers.rb
|
50
|
+
- lib/rmobio/webservices/soap/geocode.rb
|
51
|
+
- lib/rmobio/webservices/soap/messaging.rb
|
52
|
+
- lib/rmobio/webservices/soap/platform.rb
|
53
|
+
- lib/rmobio/ads/m_khoj.rb
|
54
|
+
- lib/rmobio/ads/smaato.rb
|
55
|
+
- lib/rmobio/ads/ad_sense.rb
|
56
|
+
- lib/rmobio/ads/ad_mobs.rb
|
57
|
+
has_rdoc: false
|
58
|
+
homepage: http://test01.mobio.net/svn/platform/trunk/rails/rmobio
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
version:
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
requirements: []
|
77
|
+
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 1.0.1
|
80
|
+
signing_key:
|
81
|
+
specification_version: 2
|
82
|
+
summary: RMobio API
|
83
|
+
test_files: []
|
84
|
+
|