xing_api 0.1
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/xing_api/activity/comment.rb +17 -0
- data/lib/xing_api/activity/like.rb +17 -0
- data/lib/xing_api/activity.rb +17 -0
- data/lib/xing_api/base.rb +18 -0
- data/lib/xing_api/bookmark.rb +17 -0
- data/lib/xing_api/client.rb +112 -0
- data/lib/xing_api/contact/tag.rb +9 -0
- data/lib/xing_api/contact.rb +13 -0
- data/lib/xing_api/contact_request.rb +25 -0
- data/lib/xing_api/conversation/attachment.rb +17 -0
- data/lib/xing_api/conversation/message.rb +25 -0
- data/lib/xing_api/conversation.rb +37 -0
- data/lib/xing_api/error.rb +24 -0
- data/lib/xing_api/geo_location.rb +17 -0
- data/lib/xing_api/invite.rb +9 -0
- data/lib/xing_api/job.rb +17 -0
- data/lib/xing_api/profile_message.rb +17 -0
- data/lib/xing_api/profile_visit.rb +13 -0
- data/lib/xing_api/response_handler.rb +69 -0
- data/lib/xing_api/user/recommendation.rb +13 -0
- data/lib/xing_api/user.rb +41 -0
- data/lib/xing_api/version.rb +4 -0
- data/lib/xing_api.rb +29 -0
- metadata +136 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Activity::Comment < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(activity_id, options={})
|
5
|
+
request(:get, "/v1/activities/#{activity_id}/comments", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(activity_id, comment, options={})
|
9
|
+
request(:post, "/v1/activities/#{activity_id}/comments", {:text => comment}.merge(options))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(activity_id, comment_id, options={})
|
13
|
+
request(:delete, "/v1/activities/#{activity_id}/comments/#{comment_id}", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Activity::Like < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(activity_id, options={})
|
5
|
+
request(:get, "/v1/activities/#{activity_id}/likes", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(activity_id, options={})
|
9
|
+
request(:put, "/v1/activities/#{activity_id}/likes", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(activity_id, options={})
|
13
|
+
request(:delete, "/v1/activities/#{activity_id}/likes", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Activity < XingApi::Base
|
3
|
+
|
4
|
+
def self.find(activity_id, options={})
|
5
|
+
request(:get, "/v1/activities/#{activity_id}", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.delete(activity_id, options={})
|
9
|
+
request(:delete, "/v1/activities/#{activity_id}", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.share(activity_id, options={})
|
13
|
+
request(:post, "/v1/activities/#{activity_id}/share", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Base
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def request(http_verb, url, options={})
|
6
|
+
client = options.delete(:client) || default_client
|
7
|
+
client.request(http_verb, url, options)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def default_client
|
13
|
+
XingApi::Client.new
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Bookmark < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(options={})
|
5
|
+
request(:get, "/v1/users/me/bookmarks", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(user_id, options={})
|
9
|
+
request(:put, "/v1/users/me/bookmarks/#{user_id}", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(user_id, options={})
|
13
|
+
request(:delete, "/v1/users/me/bookmarks/#{user_id}", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Client
|
3
|
+
include XingApi::ResponseHandler
|
4
|
+
|
5
|
+
OAUTH_ATTRIBUTES = [:consumer_key, :consumer_secret, :oauth_token, :oauth_token_secret]
|
6
|
+
attr_writer *OAUTH_ATTRIBUTES
|
7
|
+
attr_accessor :request_token_hash
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_accessor :default_options
|
11
|
+
|
12
|
+
def configure(&block)
|
13
|
+
instance = self.new
|
14
|
+
yield instance
|
15
|
+
self.default_options = instance.send(:to_hash)
|
16
|
+
end
|
17
|
+
end # class << self
|
18
|
+
|
19
|
+
def initialize(options={})
|
20
|
+
options = (self.class.default_options ||= {}).merge(options)
|
21
|
+
OAUTH_ATTRIBUTES.each do |attribute|
|
22
|
+
send "#{attribute}=", options[attribute]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def request(http_verb, url, options={})
|
27
|
+
full_url = url + hash_to_params(options)
|
28
|
+
handle(access_token.request(http_verb, full_url))
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_request_token(oauth_callback='oob')
|
32
|
+
ensure_attributes_are_set! %w(consumer_key consumer_secret)
|
33
|
+
|
34
|
+
request_token = request_token(oauth_callback)
|
35
|
+
self.request_token_hash = {
|
36
|
+
request_token: request_token.token,
|
37
|
+
request_token_secret: request_token.secret,
|
38
|
+
authorize_url: request_token.authorize_url
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_access_token(verifier, options={})
|
43
|
+
ensure_attributes_are_set! %w(consumer_key consumer_secret)
|
44
|
+
|
45
|
+
options = request_token_hash.merge(options) if request_token_hash
|
46
|
+
request_token = options[:request_token] || raise('request_token missing')
|
47
|
+
request_token_secret = options[:request_token_secret] || raise('request_token_secret missing')
|
48
|
+
|
49
|
+
request_token = OAuth::RequestToken.new(consumer, request_token, request_token_secret)
|
50
|
+
access_token = request_token.get_access_token(:oauth_verifier => verifier)
|
51
|
+
self.oauth_token = access_token.token
|
52
|
+
self.oauth_token_secret = access_token.secret
|
53
|
+
{
|
54
|
+
access_token: access_token.token,
|
55
|
+
access_token_secret: access_token.secret
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
OAUTH_ATTRIBUTES.each do |attribute|
|
60
|
+
define_method(attribute) do
|
61
|
+
instance_variable_get("@#{attribute}") || self.class.default_options[attribute]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def to_hash
|
68
|
+
{
|
69
|
+
:consumer_key => consumer_key,
|
70
|
+
:consumer_secret => consumer_secret,
|
71
|
+
:oauth_token => oauth_token,
|
72
|
+
:oauth_token_secret => oauth_token_secret
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
def request_token(oauth_callback)
|
77
|
+
@request_token ||= consumer.get_request_token(:oauth_callback => oauth_callback)
|
78
|
+
end
|
79
|
+
|
80
|
+
def consumer
|
81
|
+
OAuth::Consumer.new(consumer_key, consumer_secret, xing_oauth_options)
|
82
|
+
end
|
83
|
+
|
84
|
+
def access_token
|
85
|
+
OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)
|
86
|
+
end
|
87
|
+
|
88
|
+
def xing_oauth_options
|
89
|
+
{
|
90
|
+
:site => ENV['XING_API_SITE'] || 'https://api.xing.com',
|
91
|
+
:request_token_path => '/v1/request_token',
|
92
|
+
:authorize_path => '/v1/authorize',
|
93
|
+
:access_token_path => '/v1/access_token',
|
94
|
+
:signature_method => 'PLAINTEXT',
|
95
|
+
:oauth_version => '1.0',
|
96
|
+
:scheme => 'query_string'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
def hash_to_params(hash)
|
101
|
+
return '' if hash.empty?
|
102
|
+
'?' + hash.map {|k,v| "#{k}=#{CGI.escape(v.to_s)}"}.join('&')
|
103
|
+
end
|
104
|
+
|
105
|
+
def ensure_attributes_are_set!(attribute_names)
|
106
|
+
Array(attribute_names).each do |attribute_name|
|
107
|
+
raise "#{attribute_name} is missing" unless send(attribute_name)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Contact < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(user_id, options={})
|
5
|
+
request(:get, "/v1/users/#{user_id}/contacts", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.shared(user_id, options={})
|
9
|
+
request(:get, "/v1/users/#{user_id}/contacts/shared", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module XingApi
|
2
|
+
class ContactRequest < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(options={})
|
5
|
+
request(:get, '/v1/users/me/contact_requests', options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(user_id, options={})
|
9
|
+
request(:post, "/v1/users/#{user_id}/contact_requests", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.accept(user_id, options={})
|
13
|
+
request(:put, "/v1/users/#{user_id}/contact_requests/me/accept", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.deny(user_id, options={})
|
17
|
+
request(:delete, "/v1/users/me/contact_requests/#{user_id}", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.sent(options={})
|
21
|
+
request(:get, '/v1/users/me/contact_requests/sent', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Conversation::Attachment < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(conversation_id, options={})
|
5
|
+
request(:get, "/v1/users/me/conversations/#{conversation_id}/attachments", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.find(conversation_id, attachment_id, options={})
|
9
|
+
request(:get, "/v1/users/me/conversations/#{conversation_id}/attachments/#{attachment_id}", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.download_url(conversation_id, attachment_id, options={})
|
13
|
+
request(:post, "/v1/users/me/conversations/#{conversation_id}/attachments/#{attachment_id}/download", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Conversation::Message < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(conversation_id, options={})
|
5
|
+
request(:get, "/v1/users/me/conversations/#{conversation_id}/messages", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(conversation_id, content, options={})
|
9
|
+
request(:post, "/v1/users/me/conversations/#{conversation_id}/messages", {:content => content}.merge(options))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.find(conversation_id, message_id, options={})
|
13
|
+
request(:get, "/v1/users/me/conversations/#{conversation_id}/messages/#{message_id}", options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.read(conversation_id, message_id, options={})
|
17
|
+
request(:put, "/v1/users/me/conversations/#{conversation_id}/messages/#{message_id}/read", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.unread(conversation_id, message_id, options={})
|
21
|
+
request(:delete, "/v1/users/me/conversations/#{conversation_id}/messages/#{message_id}/read", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Conversation < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(options={})
|
5
|
+
request(:get, '/v1/users/me/conversations', options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.find(conversation_id, options={})
|
9
|
+
request(:get, "/v1/users/me/conversations/#{conversation_id}", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.create(recipient_ids, subject, content, options={})
|
13
|
+
request(:post, '/v1/users/me/conversations', {
|
14
|
+
:recipient_ids => recipient_ids,
|
15
|
+
:subject => subject,
|
16
|
+
:content => content
|
17
|
+
}.merge(options))
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.delete(conversation_id, options={})
|
21
|
+
request(:delete, "/v1/users/me/conversations/#{conversation_id}", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.valid_recipient(recipient_id, options={})
|
25
|
+
request(:get, "/v1/users/me/conversations/valid_recipients/#{recipient_id}", options)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.invite(conversation_id, user_id, options={})
|
29
|
+
request(:put, "/v1/users/me/conversations/#{conversation_id}/participants/#{user_id}", options)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.read(conversation_id, options={})
|
33
|
+
request(:put, "/v1/users/me/conversations/#{conversation_id}/read", options)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Error < StandardError
|
3
|
+
attr_reader :status_code, :name, :text
|
4
|
+
|
5
|
+
def initialize(status_code, name = '', text = '')
|
6
|
+
@status_code = status_code
|
7
|
+
@name = name
|
8
|
+
@text = text
|
9
|
+
super(text)
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
[status_code, name, text].join(' - ')
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
class OauthError < XingApi::Error; end
|
19
|
+
class ServerError < XingApi::Error; end
|
20
|
+
class AccessDeniedError < XingApi::Error; end
|
21
|
+
class InvalidParameterError < XingApi::Error; end
|
22
|
+
class InvalidOauthTokenError < XingApi::Error; end
|
23
|
+
class RateLimitExceededError < XingApi::Error; end
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class GeoLocation < XingApi::Base
|
3
|
+
|
4
|
+
def self.create(accuracy, latitude, longitude, options={})
|
5
|
+
request(:put, '/v1/users/me/geo_location', {
|
6
|
+
:accuracy => accuracy,
|
7
|
+
:latitude => latitude,
|
8
|
+
:longitude => longitude
|
9
|
+
}.merge(options))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.nearby_users(options={})
|
13
|
+
request(:get, '/v1/users/me/nearby_users', options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/xing_api/job.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class Job < XingApi::Base
|
3
|
+
|
4
|
+
def self.find(job_id, options={})
|
5
|
+
request(:get, "/v1/jobs/#{job_id}", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.search(query, options={})
|
9
|
+
request(:get, '/v1/jobs/find', {:query => query}.merge(options))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.recommendations(options={})
|
13
|
+
request(:get, '/v1/users/me/jobs/recommendations', options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module XingApi
|
2
|
+
class ProfileMessage < XingApi::Base
|
3
|
+
|
4
|
+
def self.find(user_id, options={})
|
5
|
+
request(:get, "/v1/users/#{user_id}/profile_message", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.update(message, options={})
|
9
|
+
request(:put, '/v1/users/me/profile_message', {:message => message}.merge(options))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(options={})
|
13
|
+
request(:put, '/v1/users/me/profile_message', {:message => ''}.merge(options))
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module XingApi
|
2
|
+
class ProfileVisit < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(options={})
|
5
|
+
request(:get, '/v1/users/me/visits', options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(user_id, options={})
|
9
|
+
request(:post, "/v1/users/#{user_id}/visits", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module XingApi
|
2
|
+
module ResponseHandler
|
3
|
+
|
4
|
+
OAUTH_ERROR_RESPONSES = %w(
|
5
|
+
INVALID_OAUTH_CONSUMER
|
6
|
+
CONSUMER_MISMATCH
|
7
|
+
INVALID_OAUTH_SIGNATURE_METHOD
|
8
|
+
INVALID_OAUTH_SIGNATURE
|
9
|
+
INVALID_TIMESTAMP
|
10
|
+
TIMESTAMP_EXPIRED
|
11
|
+
NONCE_ALREADY_USED
|
12
|
+
NONCE_MISSING
|
13
|
+
INVALID_OAUTH_VERSION
|
14
|
+
REQUIRED_PARAMETER_MISSING
|
15
|
+
)
|
16
|
+
|
17
|
+
def handle(response)
|
18
|
+
return {} if response.code.to_i == 204
|
19
|
+
|
20
|
+
unless (200..299).include?(response.code.to_i)
|
21
|
+
raise_failed_response!(response)
|
22
|
+
end
|
23
|
+
|
24
|
+
JSON.parse(response.body.to_s, :symbolize_names => true)
|
25
|
+
rescue JSON::ParserError
|
26
|
+
{}
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def raise_failed_response!(response)
|
32
|
+
status_code = response.code.to_i
|
33
|
+
body = parse_json(response)
|
34
|
+
error_class = failed_response_for(status_code, body[:error_name])
|
35
|
+
|
36
|
+
raise error_class.new(status_code, body[:error_name], body[:message])
|
37
|
+
end
|
38
|
+
|
39
|
+
def failed_response_for(status_code, error_name)
|
40
|
+
case status_code
|
41
|
+
when 401
|
42
|
+
case error_name
|
43
|
+
when *OAUTH_ERROR_RESPONSES
|
44
|
+
XingApi::OauthError
|
45
|
+
when 'INVALID_OAUTH_TOKEN'
|
46
|
+
XingApi::InvalidOauthTokenError
|
47
|
+
end
|
48
|
+
when 403
|
49
|
+
case error_name
|
50
|
+
when 'RATE_LIMIT_EXCEEDED'
|
51
|
+
XingApi::RateLimitExceededError
|
52
|
+
when 'ACCESS_DENIED'
|
53
|
+
XingApi::AccessDeniedError
|
54
|
+
when 'INVALID_PARAMETERS'
|
55
|
+
XingApi::InvalidParameterError
|
56
|
+
end
|
57
|
+
when (500..504)
|
58
|
+
XingApi::ServerError
|
59
|
+
end || XingApi::Error
|
60
|
+
end
|
61
|
+
|
62
|
+
def parse_json(response)
|
63
|
+
body = JSON.parse(response.body.to_s, :symbolize_names => true)
|
64
|
+
rescue JSON::ParserError
|
65
|
+
{ message: response.body.to_s }
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module XingApi
|
2
|
+
class User::Recommendation < XingApi::Base
|
3
|
+
|
4
|
+
def self.list(options={})
|
5
|
+
request(:get, '/v1/users/me/network/recommendations', options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.delete(user_id, options={})
|
9
|
+
request(:delete, "/v1/users/me/network/recommendations/user/#{user_id}", options)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module XingApi
|
2
|
+
class User < XingApi::Base
|
3
|
+
|
4
|
+
def self.find(user_id, options={})
|
5
|
+
request(:get, "/v1/users/#{user_id}", options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.me(options={})
|
9
|
+
find('me', options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.id_card(options={})
|
13
|
+
request(:get, '/v1/users/me/id_card', options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.activities(user_id, options={})
|
17
|
+
request(:get, "/v1/users/#{user_id}/feed", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.network_activities(options={})
|
21
|
+
request(:get, "/v1/users/me/network_feed", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.shared(user_id, options={})
|
25
|
+
request(:get, "/v1/users/#{user_id}/contacts/shared", options)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.paths(user_id, options={})
|
29
|
+
request(:get, "/v1/users/me/network/#{user_id}/paths", options)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.find_by_emails(emails, options={})
|
33
|
+
request(:get, '/v1/users/find_by_emails', {:emails => emails}.merge(options))
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.status_message(message, options={})
|
37
|
+
request(:post, '/v1/users/me/status_message', {:message => message}.merge(options))
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
data/lib/xing_api.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'oauth'
|
2
|
+
require 'oauth/signature/plaintext'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
require 'xing_api/response_handler'
|
6
|
+
require 'xing_api/client'
|
7
|
+
require 'xing_api/base'
|
8
|
+
require 'xing_api/error'
|
9
|
+
|
10
|
+
require 'xing_api/activity'
|
11
|
+
require 'xing_api/activity/comment'
|
12
|
+
require 'xing_api/activity/like'
|
13
|
+
require 'xing_api/bookmark'
|
14
|
+
require 'xing_api/contact'
|
15
|
+
require 'xing_api/contact/tag'
|
16
|
+
require 'xing_api/contact_request'
|
17
|
+
require 'xing_api/conversation'
|
18
|
+
require 'xing_api/conversation/attachment'
|
19
|
+
require 'xing_api/conversation/message'
|
20
|
+
require 'xing_api/geo_location'
|
21
|
+
require 'xing_api/invite'
|
22
|
+
require 'xing_api/job'
|
23
|
+
require 'xing_api/profile_message'
|
24
|
+
require 'xing_api/profile_visit'
|
25
|
+
require 'xing_api/user'
|
26
|
+
require 'xing_api/user/recommendation'
|
27
|
+
|
28
|
+
module XingApi
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xing_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mark Schmidt
|
9
|
+
- Johannes Strampe
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: oauth
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.4.7
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.4.7
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: mocha
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: debugger
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
description: Provides access to every endpoint of the XING API. Takes care of oauth,
|
80
|
+
reponse parsing and simplifies error handling. You can get the required consumer_key
|
81
|
+
and consumer_secret at https://dev.xing.com
|
82
|
+
email:
|
83
|
+
- api-support@xing.com
|
84
|
+
executables: []
|
85
|
+
extensions: []
|
86
|
+
extra_rdoc_files: []
|
87
|
+
files:
|
88
|
+
- lib/xing_api/activity/comment.rb
|
89
|
+
- lib/xing_api/activity/like.rb
|
90
|
+
- lib/xing_api/activity.rb
|
91
|
+
- lib/xing_api/base.rb
|
92
|
+
- lib/xing_api/bookmark.rb
|
93
|
+
- lib/xing_api/client.rb
|
94
|
+
- lib/xing_api/contact/tag.rb
|
95
|
+
- lib/xing_api/contact.rb
|
96
|
+
- lib/xing_api/contact_request.rb
|
97
|
+
- lib/xing_api/conversation/attachment.rb
|
98
|
+
- lib/xing_api/conversation/message.rb
|
99
|
+
- lib/xing_api/conversation.rb
|
100
|
+
- lib/xing_api/error.rb
|
101
|
+
- lib/xing_api/geo_location.rb
|
102
|
+
- lib/xing_api/invite.rb
|
103
|
+
- lib/xing_api/job.rb
|
104
|
+
- lib/xing_api/profile_message.rb
|
105
|
+
- lib/xing_api/profile_visit.rb
|
106
|
+
- lib/xing_api/response_handler.rb
|
107
|
+
- lib/xing_api/user/recommendation.rb
|
108
|
+
- lib/xing_api/user.rb
|
109
|
+
- lib/xing_api/version.rb
|
110
|
+
- lib/xing_api.rb
|
111
|
+
homepage: https://github.com/xing/xing_api
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 1.3.5
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 1.8.23
|
133
|
+
signing_key:
|
134
|
+
specification_version: 3
|
135
|
+
summary: Official Ruby wrapper for the XING API
|
136
|
+
test_files: []
|