Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
61b9b21
Added current user's shares as an option (client.shares)
dylandrop May 31, 2012
dae65d8
Merge pull request #123 from dylandrop/master
pengwynn Jun 27, 2012
f32f2eb
make update_comment functional
vivekkhokhar Jul 3, 2012
35e65b3
Methods to work with comments/likes for share
Aug 6, 2012
bb1372c
Merge pull request #131 from slavik112211/master
ryanatwork Aug 24, 2012
ae283b0
fix to be able to pass the permission scope
Sep 9, 2012
9493b2e
fix the permission param passing
Sep 9, 2012
44d6bbe
Add test that right params are passed to OAuth gem
Sep 18, 2012
49cb6c4
Fixing broken api_spec due to change in webmock see https://github.co…
Apr 10, 2013
4974b45
Fixing vcr cassettes by rerunning the api hits: malformed JSON caused…
Apr 10, 2013
c3bdee2
Bump hashie version
joshjordan May 1, 2013
85cd822
Merge pull request #152 from joshjordan/jsj-hashie-version
hexgnu May 2, 2013
3ccc712
Add option to specify a proxy
AlexParamonov May 20, 2013
91bed7b
Merge pull request #155 from AlexParamonov/add_proxy_option
hexgnu May 20, 2013
d441806
Merge pull request #137 from rajeshucsb/master
hexgnu May 30, 2013
86d3f55
Bump to Version 0.4.0, Changes since 0.3.7:
May 30, 2013
3227a23
Adding 0.4.0 to changelog
May 30, 2013
d288cc4
Fixing e-mail domain filtering issue brought up in PR #101
Jun 4, 2013
e001bf5
Sanitizing query parameter building
Jun 4, 2013
b044a34
Updating the status example
Jun 4, 2013
dd64adb
Implemented the Job API, view job, view user bookmarks, add user book…
antek-drzewiecki Jun 6, 2013
fe51c7f
Merge pull request #157 from Antek-drzewiecki/query-jobs
hexgnu Jun 6, 2013
4e010db
Fixing possible bug from array key value pairs
Jun 6, 2013
f8d3315
Bumping from 0.4.0 to 0.4.1:
Jun 6, 2013
c352ef6
Add syntax highlighting to ruby code on README
edgurgel Jun 11, 2013
8672058
Merge pull request #159 from edgurgel/patch-1
hexgnu Jun 11, 2013
b3f496c
Updating all of the old development gems
Jun 19, 2013
6c0f8ac
Fixing issue #166
Aug 6, 2013
4719b64
Version bump to 0.4.2 to fix issue with updates on networks
Aug 6, 2013
ee417df
Updated field references to "educations"
rmm5t Aug 12, 2013
a24271e
Merge pull request #168 from rmm5t/educations-field
hexgnu Aug 12, 2013
6e5124d
modified the query methods to support groups as well as nested field …
avanrielly Sep 12, 2013
dafbee0
Manually merging in changes from PR #160
Sep 30, 2013
6c755e8
Version bump to 0.4.3 to add more group functionality as well as fixi…
Sep 30, 2013
abbdfbb
update the travis image
joshk Oct 7, 2013
9a07a19
Add support to company updates, company update comments and linkes, c…
Ian-Choi Aug 2, 2013
117c1a6
Adding gemmaros' commits to hexgnu's current branch
mijoharas Oct 14, 2013
0f45908
added follow company requests
mijoharas Oct 14, 2013
016fe46
bugfix
mijoharas Oct 14, 2013
7452540
added tests
mijoharas Oct 15, 2013
3d206aa
added missing line to query_methods
mijoharas Oct 15, 2013
fdf4f6e
Merge pull request #179 from mhauserr/master
hexgnu Oct 15, 2013
215d266
Changing up travis to only test 2.0.0 jruby and rubinius
Oct 15, 2013
c5fbf0e
Fixed an issue with double ? in the query paramters
Nov 13, 2013
723d248
Merge pull request #180 from ismell/query-param-fix
hexgnu Nov 13, 2013
4154e25
Added method to get user's picture urls
DKarp Aug 7, 2013
451198c
Add tests for view picture urls
DKarp Aug 7, 2013
c76840c
Dont limit group posts to only title and summary
Nov 15, 2013
afa8abd
Merge pull request #185 from ismell/allow-content-on-group-post
hexgnu Nov 18, 2013
ad73227
Added an example for the communication API using the messages.
schallereqo Dec 6, 2013
10990c3
Merge pull request #189 from schallereqo/master
hexgnu Dec 6, 2013
bfe052d
merged in master
avanrielly Dec 9, 2013
6786c90
added nested fields back
avanrielly Dec 9, 2013
d0ea476
Removed commented out line
avanrielly Dec 9, 2013
80fb39d
added specs and tweaked code based on feedback
avanrielly Dec 9, 2013
c9bd712
Merge branch 'master' of github.com:aorielly/linkedin
avanrielly Dec 9, 2013
b52a8c4
removed duplicate checks in build_field_params
avanrielly Dec 9, 2013
31b0a18
renaming to match the other shares
avanrielly Dec 9, 2013
8d58d46
Making the authenticate.rb example a little clearer
Dec 17, 2013
3699a5a
Cleanup of LICENSE, README and gemspec
Dec 17, 2013
cbba2b4
Update LICENSE
pengwynn Jan 10, 2014
164c1e8
Merge pull request #195 from hexgnu/add-license-description
pengwynn Jan 10, 2014
6f25336
Merge pull request #190 from aorielly/master
Jan 11, 2014
fd14856
Version bump and changelog changed
hexgnu Jan 11, 2014
764b50e
Test more versions of ruby
hexgnu Jan 11, 2014
bc06a48
Version 0.4.5 not 0.4.4
hexgnu Jan 11, 2014
8748897
Fixing up gemspec warnings
hexgnu Jan 11, 2014
cd24598
Added tests and functions to do a singular email search.
brentkastner Jan 13, 2014
7071405
Added multi-email support and testing.
brentkastner Jan 13, 2014
bd99f03
Added an example invocation.
brentkastner Jan 13, 2014
d9e945e
Added unauthorized test and cassette.
brentkastner Jan 14, 2014
72d282b
Cleaning up trailing spaces.
brentkastner Jan 14, 2014
3af72c9
Fixed unauthorized response test.
brentkastner Jan 14, 2014
e4d7578
Removed underscores from test describes.
brentkastner Jan 14, 2014
b8ba113
Addressed response body from an unauthorized request. Addressed url …
brentkastner Jan 14, 2014
7c90cad
add a method to get group suggestions for a profile
kjpatel Jan 15, 2014
d51c592
Merge pull request #197 from brentkastner/master
Jan 15, 2014
bdef2a6
Allowing _key to be converted if there is no collisions
hexgnu Jan 15, 2014
f269600
LinkedIn::Mash#all returns [] instead of nil when there are no results
hundredwatt Jan 15, 2014
087d501
Merge pull request #199 from hundredwatt/all_mash_method
Jan 16, 2014
0da50fa
Merge pull request #198 from kjpatel/feature/group_suggestions
Jan 16, 2014
9401aeb
Warning about post_group_discussion
hexgnu Jan 16, 2014
a2b1f85
Switch to yard instead of rdoc
hundredwatt Jan 16, 2014
eec4b4e
Consistent, simple file naming
hundredwatt Jan 18, 2014
4e3b2ca
Updates to README
hundredwatt Jan 18, 2014
833ccad
Document all query and update methods
hundredwatt Jan 18, 2014
24fe6ec
Document Exceptions, Search, and Mash
hundredwatt Jan 18, 2014
b1f7de2
Re-organize modules under Api namespace
hundredwatt Jan 18, 2014
e726c81
Review and edit documentation
hundredwatt Jan 18, 2014
b416861
Use consistent and revealing arugment names
hundredwatt Jan 18, 2014
76bf893
Add method for Finding New Connections
hundredwatt Jan 18, 2014
921617b
Convert examples to markdown pages
hundredwatt Jan 18, 2014
19f0eb5
Bring all examples into 1 file
hundredwatt Jan 25, 2014
7e4d963
CHANGELOG entry for documentation (#204)
hundredwatt Jan 25, 2014
056e416
Use link to rdoc.info under Documentation section of README
hundredwatt Jan 25, 2014
df1226b
Correct description in README (gem no longer connects to XML API)
hundredwatt Jan 25, 2014
2a38843
Merge pull request #204 from hundredwatt/docs
Jan 27, 2014
83b50a7
Update EXAMPLES.md
pbechu Jan 27, 2014
7ea2b7a
Merge pull request #209 from pbechu/patch-1
Jan 27, 2014
ff3aa0e
Fixing jruby error by using kramdown and updating the README a bit
hexgnu Jan 29, 2014
37b9e1d
Get rid of JRUBY 18 mode since we don't support 18 otherwise
hexgnu Jan 29, 2014
8136bae
Adding rubysl for travis
hexgnu Jan 30, 2014
60912bc
Fixing rbx errors
hexgnu Jan 30, 2014
4c92aac
More changes to the dumb linkedin fixtures
hexgnu Jan 30, 2014
c4f419c
Fixing json errors
hexgnu Jan 30, 2014
589bf64
Folding in the \ns
hexgnu Jan 30, 2014
900abc5
Little tweaks
hexgnu Jan 30, 2014
49cabe8
Fixing up errors
hexgnu Jan 30, 2014
3d63a95
Ugh this is getting old
hexgnu Jan 30, 2014
de9efef
More fixes to spec fixtures
hexgnu Jan 30, 2014
bb6bd87
Fixing rest of JSON errors
hexgnu Jan 30, 2014
a022f85
More fixes to fixtures
hexgnu Jan 30, 2014
773a64c
Facets this time
hexgnu Jan 30, 2014
58f1596
Mk all of this now
hexgnu Jan 30, 2014
9f6b63d
Hope this fixes it
hexgnu Jan 30, 2014
428f179
Fix links to examples & changelog in README.md
bschaeffer Feb 5, 2014
71ad5ec
Merge pull request #213 from bschaeffer/patch-1
Feb 5, 2014
4497cec
added example and docs for picture_urls
schallereqo Feb 20, 2014
d55c183
Merge pull request #217 from schallereqo/master
Feb 20, 2014
6ad3852
Updated VCR config. Use RSpec metadata options. Fixes #1
Mar 31, 2014
0a23813
Merge pull request #219 from martin-schmidt/VCR_deprecated_warnings
Mar 31, 2014
3abb630
Bumped hashie dependency
robertwbradford Apr 15, 2014
d29f950
Merge pull request #222 from robertwbradford/master
Apr 15, 2014
64ae382
Update query_helpers.rb
May 6, 2014
b5d9caf
Merge pull request #224 from tommybstitch/patch-1
May 19, 2014
f933456
added example and docs for secure image over https
schallereqo Jun 30, 2014
c0ec6a6
Merge pull request #230 from schallereqo/master
Jun 30, 2014
592f583
New dependencies Fixes #234
hexgnu Aug 4, 2014
427d10e
Build Fix
sahild Aug 10, 2014
7c358d8
Code fencing fix
leereilly Aug 12, 2014
5bc28e6
Merge pull request #236 from leereilly/code-fencing
Aug 12, 2014
74fabb9
Fix example for client.request_token scope
tjoyal Oct 11, 2014
677ad93
Start on porting this over to oauth2
danielfarrell Oct 23, 2014
768b202
Merge pull request #246 from tjoyal/master
hexgnu Nov 9, 2015
aa858f0
Add ability to fetch a single share
santib Dec 29, 2015
0430cc8
Merge pull request #259 from santib/ability_fetch_single_share
hexgnu Dec 30, 2015
f59a8a3
Bump version
hexgnu Jan 27, 2016
b5626eb
Update links for Companies API
abhinaykumar Apr 22, 2016
1cb4273
Update documentation links
abhinaykumar Apr 28, 2016
99b650a
fix link in people API
abhinaykumar Apr 28, 2016
43a7410
Merge pull request #263 from abhinaykumar/update_docs_link
hexgnu May 3, 2016
85f3136
Inherit from LinkedInError
sutanto Jul 25, 2016
fb6c5f6
Merge pull request #265 from sutanto/inherit-from-linkedinerror
hexgnu Jul 25, 2016
a7ecdc5
added shield to RapidAPI
phillipseymor Feb 15, 2017
1356a40
Merge pull request #267 from phillipseymor/patch-1
hexgnu Feb 15, 2017
a6a46ba
Revert "added shield to RapidAPI"
hexgnu Mar 10, 2017
a69985f
Merge branch 'oauth2' of git://github.com/danielfarrell/linkedin into…
ryanatwork Aug 8, 2018
10b207d
Merge branch 'danielfarrell-oauth2'
ryanatwork Aug 8, 2018
ac0383d
Merge pull request #235 from sahild/master
ryanatwork Aug 8, 2018
90e28e5
Remove rbx and add support for 2.3,2.4,2.5
ryanatwork Aug 8, 2018
411250f
Change log for OAuth2
ryanatwork Aug 8, 2018
a56f538
Bump to verion 1.1.1
ryanatwork Aug 8, 2018
6c3535c
Clarifying what is `code`
Sohair63 Oct 4, 2019
076fc8a
Merge pull request #275 from Sohair63/patch-1
hexgnu Jan 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .document

This file was deleted.

9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
rvm:
- 1.8.7
- 1.9.2
- 2.5
- 2.4
- 2.3
- 2.0.0
- 2.1.0
- 1.9.3
- ree
- jruby-19mode
7 changes: 7 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--no-private
--markup markdown
-
README.md
CHANGELOG.md
LICENSE
EXAMPLES.md
34 changes: 33 additions & 1 deletion changelog.markdown → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

* Document all methods
* Re-organize modules under Api to match organization in LinkedIn's REST
API documentation

## 1.1.1 - August 8, 2018

* Switch to OAuth2

## 0.4.4 - Jan 11, 2014

* Group share add
* Readme updates

## 0.4.3

## 0.4.2

## 0.4.1

## 0.4.0 - May 30, 2013

* Add capability to ask for desired permissions from linked in api
* Add option to specify a proxy
* Bump hashie version
* fix the permission param passing
* fix to be able to pass the permission scope
* Manipulating comments/likes for network_updates ('shares')
* Methods to work with comments/likes for share
* Added a method to get a user's shares
* Added current user's shares as an option (client.shares)
* Readme Typos

## 0.2.x - March x, 2010

* Removed Crack as a dependency, Nokogiri FTW
Expand Down Expand Up @@ -68,4 +100,4 @@

## 0.0.1 - November 24, 2009

* Initial release
* Initial release
200 changes: 200 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Linkedin Gem Examples

## OAuth2 Authentication

Here's an example of authenticating with the LinkedIn API

```ruby
require 'rubygems'
require 'linkedin'

# get your api keys at https://www.linkedin.com/secure/developer
client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret')

# If you want to use one of the scopes from linkedin you have to pass it in at this point
# You can learn more about it here: http://developer.linkedin.com/documents/authentication

# to test from your desktop, open the following url in your browser
# and record the pin it gives you
client.authorize_url(:redirect_uri => 'https:://www.yourdomain.com/callback', :state => SecureRandom.uuid, :scope => "r_basicprofile+r_emailaddress")
=> "https://api.linkedin.com/uas/oauth2/authorization?"

# then fetch your access keys
client.authorize_from_request(params[:code], :redirect_uri => 'https:://www.yourdomain.com/callback')
=> "OU812" # <= save this for future requests

NOTE: params[:code] is returned in the callback

# or authorize from previously fetched access keys
client.authorize_from_access("OU812")

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


## Profile

Here are some examples of accessing a user's profile

```ruby
# AUTHENTICATE FIRST found in examples/authenticate.rb

# client is a LinkedIn::Client

# get the profile for the authenticated user
client.profile

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

# get a profile for someone via their public profile url
client.profile(:url => 'http://www.linkedin.com/in/netherland')

# provides the ability to access authenticated user's company field in the profile
user = client.profile(:fields => %w(positions))
companies = user.positions.all.map{|t| t.company}
# Example: most recent company can be accessed via companies[0]

# Example of a multi-email search against the special email search API
account_exists = client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => ['id'])
```


## Sending a Message

Here's an example of sending a message to two recipients

```ruby
# AUTHENTICATE FIRST found in examples/authenticate.md

# client is a LinkedIn::Client

# send a message to a person in your network. you will need to authenticate the
# user and ask for the "w_messages" permission.
response = client.send_message("subject", "body", ["person_1_id", "person_2_id"])
```


## User's Network

Here are some examples of accessing network updates and connections of
the authenticated user

``` ruby
# AUTHENTICATE FIRST found in examples/authenticate.rb

# client is a LinkedIn::Client

# get network updates for the authenticated user
client.network_updates

# get profile picture changes
client.network_updates(:type => 'PICT')

# view connections for the currently authenticated user
client.connections

# get the original picture-url for one of the connections
client.picture_urls(:id => 'id_of_connection')

# get the image over https instead of http
client.picture_urls(:id => 'id_of_connection', :secure => "true")
```
## Update User's Status

Here's an example of updating the current user's status

```ruby
# AUTHENTICATE FIRST found in examples/authenticate.rb

# client is a LinkedIn::Client

# update status for the authenticated user
client.add_share(:comment => 'is playing with the LinkedIn Ruby gem')
```


## Sinatra App

Here's an example sinatra application that performs authentication,
after which some info about the authenticated user can be retrieved.

```ruby
require "rubygems"
require "haml"
require "sinatra"
require "linkedin"

enable :sessions

helpers do
def login?
!session[:atoken].nil?
end

def profile
linkedin_client.profile unless session[:atoken].nil?
end

def connections
linkedin_client.connections unless session[:atoken].nil?
end

private
def linkedin_client
client = LinkedIn::Client.new(settings.api, settings.secret)
client.authorize_from_access(session[:atoken])
client
end

end

configure do
# get your api keys at https://www.linkedin.com/secure/developer
set :api, "your_api_key"
set :secret, "your_secret"
end

get "/" do
haml :index
end

get "/auth" do
client = LinkedIn::Client.new(settings.api, settings.secret)
request_token = client.request_token(:oauth_callback => "http://#{request.host}:#{request.port}/auth/callback")
session[:rtoken] = request_token.token
session[:rsecret] = request_token.secret

redirect client.request_token.authorize_url
end

get "/auth/logout" do
session[:atoken] = nil
redirect "/"
end

get "/auth/callback" do
client = LinkedIn::Client.new(settings.api, settings.secret)
if session[:atoken].nil?
pin = params[:oauth_verifier]
atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)
session[:atoken] = atoken
session[:asecret] = asecret
end
redirect "/"
end


__END__
@@index
-if login?
%p Welcome #{profile.first_name}!
%a{:href => "/auth/logout"} Logout
%p= profile.headline
%br
%div= "You have #{connections.total} connections!"
-connections.all.each do |c|
%div= "#{c.first_name} #{c.last_name} - #{c.headline}"
-else
%a{:href => "/auth"} Login using LinkedIn
```
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ platforms :jruby do
gem 'jruby-openssl', '~> 0.7'
end

platforms :rbx do
gem 'rubysl'
end

gemspec
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) 2009 Wynn Netherland
The MIT License (MIT)

Copyright (c) 2009 Wynn Netherland & Matthew Kirk

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
78 changes: 0 additions & 78 deletions README.markdown

This file was deleted.

Loading