Project

xing

0.02
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for Xing API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 0.9
~> 3.8
~> 2.6
~> 1.8.7

Runtime

~> 1.2.0
~> 1.0.3
~> 0.4.5
 Project Readme

xing

Ruby wrapper for the Xing API.

Supported Rubies

Currently, only Ruby 2.0 is supported.

Installation

[sudo] gem install xing

Usage

Authenticate

Xing's API uses Oauth for authentication. Luckily, the Xing gem hides most of the gory details from you.

require 'rubygems'
require 'xing'

# Visit the [XING Developer Portal](https://dev.xing.com/applications) to get your API keys.
client = Xing::Client.new(:consumer_key => 'your_consumer_key', :consumer_secret => 'your_consumer_secret')
rtoken = client.request_token.token
rsecret = client.request_token.secret

# to test from your desktop, open the following url in your browser
# and record the pin it gives you
client.request_token.authorize_url
=> "https://api.xing.com/v1/authorize?oauth_token=<generated_token>"

# then fetch your access keys
client.authorize_from_request(rtoken, rsecret, pin)
=> ["xxxxxxxxxxxxxxxxxxxx", "yyyyyyyyyyyyyyyyyyyy"] # <= save these for future requests

# or authorize from previously fetched access keys
client.authorize_from_access("xxxxxxxxxxxxxxxxxxxx", "yyyyyyyyyyyyyyyyyyyy")

# you're now free to move about the cabin, call any API method

Profile examples

# get the profile for the authenticated user
client.profile

# get a profile for someone found in network via ID
client.profile(:id => '17474922_3b6fca')