Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (50 sloc) 2.809 kB
999406a Added examples, updated README
Wynn Netherland authored
1 # LinkedIn
2
3 Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). Heavily inspired by [John Nunemaker's](http://github.com/jnunemaker) [Twitter gem](http://github.com/jnunemaker/twitter), the LinkedIn gem provides an easy-to-use wrapper for LinkedIn's Oauth/XML APIs.
4
e29e5e6 @sferik Use SSL-enabled build status image to avoid proxy caching
sferik authored
5 Travis CI : [![Build Status](https://secure.travis-ci.org/pengwynn/linkedin.png)](http://travis-ci.org/pengwynn/linkedin)
94cd831 @joshk added travis build status to the readme
joshk authored
6
999406a Added examples, updated README
Wynn Netherland authored
7 ## Installation
8
d6f782f @joshk removed reference to using gem tumble
joshk authored
9 [sudo] gem install linkedin
10
999406a Added examples, updated README
Wynn Netherland authored
11 ## Usage
12
13 ### Authenticate
14
15 LinkedIn's API uses Oauth for authentication. Luckily, the LinkedIn gem hides most of the gory details from you.
16
17 require 'rubygems'
18 require 'linkedin'
19
20 # get your api keys at https://www.linkedin.com/secure/developer
21 client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret')
22 rtoken = client.request_token.token
23 rsecret = client.request_token.secret
24
25 # to test from your desktop, open the following url in your browser
26 # and record the pin it gives you
27 client.request_token.authorize_url
28 => "https://api.linkedin.com/uas/oauth/authorize?oauth_token=<generated_token>"
29
30 # then fetch your access keys
31 client.authorize_from_request(rtoken, rsecret, pin)
32 => ["OU812", "8675309"] # <= save these for future requests
33
34 # or authorize from previously fetched access keys
35 c.authorize_from_access("OU812", "8675309")
36
37 # you're now free to move about the cabin, call any API method
38
39 ### Profile examples
40
41 # get the profile for the authenticated user
42 client.profile
43
44 # get a profile for someone found in network via ID
45 client.profile(:id => 'gNma67_AdI')
46
47 # get a profile for someone via their public profile url
48 client.profile(:url => 'http://www.linkedin.com/in/netherland')
410abc4 @joshk removed trailing whitespace
joshk authored
49
999406a Added examples, updated README
Wynn Netherland authored
50
51
52 More examples in the [examples folder](http://github.com/pengwynn/linkedin/blob/master/examples).
53
091ae65 added a link to an example using rails in the readme
Brad Cantin authored
54 For a nice example on using this in a [Rails App](http://pivotallabs.com/users/will/blog/articles/1096-linkedin-gem-for-a-web-app).
20810bf Initial commit to linkedin.
Wynn Netherland authored
55
3d694f1 @joshk some small readme updates
joshk authored
56 If you want to play with the LinkedIn api without using the gem, have a look at the [apigee LinkedIn console](http://app.apigee.com/console/linkedin).
20810bf Initial commit to linkedin.
Wynn Netherland authored
57
75fb55d Profile, Connection APIs
Wynn Netherland authored
58 ## TODO
999406a Added examples, updated README
Wynn Netherland authored
59
3d694f1 @joshk some small readme updates
joshk authored
60 * Change to json api
61 * Update and correct test suite
62 * Change to Faraday for authentication
999406a Added examples, updated README
Wynn Netherland authored
63 * Implement Messaging APIs
75fb55d Profile, Connection APIs
Wynn Netherland authored
64
65 ## Note on Patches/Pull Requests
410abc4 @joshk removed trailing whitespace
joshk authored
66
20810bf Initial commit to linkedin.
Wynn Netherland authored
67 * Fork the project.
68 * Make your feature addition or bug fix.
69 * Add tests for it. This is important so I don't break it in a
70 future version unintentionally.
71 * Commit, do not mess with rakefile, version, or history.
72 (if you want to have your own version, that is fine but
73 bump version in a commit by itself I can ignore when I pull)
74 * Send me a pull request. Bonus points for topic branches.
75
75fb55d Profile, Connection APIs
Wynn Netherland authored
76 ## Copyright
20810bf Initial commit to linkedin.
Wynn Netherland authored
77
edff05c @pengwynn updated copyright date
pengwynn authored
78 Copyright (c) 2009-11 [Wynn Netherland](http://wynnnetherland.com). See LICENSE for details.
Something went wrong with that request. Please try again.