linkedin-oauth2 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +9 -9
  2. data/.gitignore +24 -39
  3. data/.travis.yml +4 -4
  4. data/.yardopts +2 -0
  5. data/CHANGELOG.md +10 -0
  6. data/CONTRIBUTING.md +1 -0
  7. data/Gemfile +6 -5
  8. data/LICENSE +19 -17
  9. data/README.md +399 -0
  10. data/Rakefile +15 -22
  11. data/lib/linked_in/access_token.rb +24 -0
  12. data/lib/linked_in/api.rb +96 -3
  13. data/lib/linked_in/api_resource.rb +165 -0
  14. data/lib/linked_in/communications.rb +40 -0
  15. data/lib/linked_in/companies.rb +146 -0
  16. data/lib/linked_in/configuration.rb +41 -0
  17. data/lib/linked_in/connection.rb +31 -0
  18. data/lib/linked_in/errors.rb +33 -13
  19. data/lib/linked_in/groups.rb +116 -0
  20. data/lib/linked_in/jobs.rb +68 -0
  21. data/lib/linked_in/mash.rb +34 -34
  22. data/lib/linked_in/oauth2.rb +223 -0
  23. data/lib/linked_in/people.rb +141 -0
  24. data/lib/linked_in/search.rb +58 -43
  25. data/lib/linked_in/share_and_social_stream.rb +128 -0
  26. data/lib/linked_in/version.rb +1 -9
  27. data/lib/linkedin-oauth2.rb +43 -25
  28. data/linkedin-oauth2.gemspec +35 -21
  29. data/spec/linked_in/api/api_spec.rb +41 -0
  30. data/spec/linked_in/api/communications_spec.rb +13 -0
  31. data/spec/linked_in/api/companies_spec.rb +59 -0
  32. data/spec/linked_in/api/groups_spec.rb +55 -0
  33. data/spec/linked_in/api/jobs_spec.rb +33 -0
  34. data/spec/linked_in/api/people_spec.rb +181 -0
  35. data/spec/linked_in/api/search_spec.rb +71 -0
  36. data/spec/linked_in/api/share_and_social_stream_spec.rb +60 -0
  37. data/spec/linked_in/configuration_spec.rb +46 -0
  38. data/spec/linked_in/connection_spec.rb +10 -0
  39. data/spec/linked_in/module_loading_spec.rb +23 -0
  40. data/spec/linked_in/oauth/access_token_spec.rb +27 -0
  41. data/spec/linked_in/oauth/auth_code_spec.rb +86 -0
  42. data/spec/linked_in/oauth/credentials_spec.rb +96 -0
  43. data/spec/linked_in/oauth/get_access_token_spec.rb +108 -0
  44. data/spec/spec_helper.rb +15 -0
  45. data/spec/vcr_cassettes/access_token_success.yml +84 -0
  46. data/spec/vcr_cassettes/bad_code.yml +78 -0
  47. data/spec/vcr_cassettes/companies_data.yml +44 -0
  48. data/spec/vcr_cassettes/invalid_access_token.yml +60 -0
  49. data/spec/vcr_cassettes/not_found.yml +64 -0
  50. data/spec/vcr_cassettes/people_picture_urls.yml +54 -0
  51. data/spec/vcr_cassettes/people_profile_connections_fields.yml +73 -0
  52. data/spec/vcr_cassettes/people_profile_connections_other.yml +78 -0
  53. data/spec/vcr_cassettes/people_profile_connections_self.yml +78 -0
  54. data/spec/vcr_cassettes/people_profile_fields_complex.yml +70 -0
  55. data/spec/vcr_cassettes/people_profile_fields_simple.yml +57 -0
  56. data/spec/vcr_cassettes/people_profile_lang_spanish.yml +59 -0
  57. data/spec/vcr_cassettes/people_profile_multiple_fields.yml +68 -0
  58. data/spec/vcr_cassettes/people_profile_multiple_uids.yml +70 -0
  59. data/spec/vcr_cassettes/people_profile_multiple_uids_and_urls.yml +76 -0
  60. data/spec/vcr_cassettes/people_profile_multiple_urls.yml +70 -0
  61. data/spec/vcr_cassettes/people_profile_new_connections_fields.yml +69 -0
  62. data/spec/vcr_cassettes/people_profile_new_connections_other.yml +72 -0
  63. data/spec/vcr_cassettes/people_profile_new_connections_self.yml +72 -0
  64. data/spec/vcr_cassettes/people_profile_other_uid.yml +59 -0
  65. data/spec/vcr_cassettes/people_profile_other_url.yml +59 -0
  66. data/spec/vcr_cassettes/people_profile_own.yml +59 -0
  67. data/spec/vcr_cassettes/people_profile_own_secure.yml +59 -0
  68. data/spec/vcr_cassettes/unauthorized.yml +61 -0
  69. data/spec/vcr_cassettes/unavailable.yml +81 -0
  70. metadata +145 -88
  71. data/.autotest +0 -14
  72. data/.document +0 -5
  73. data/.gemtest +0 -0
  74. data/.rspec +0 -1
  75. data/.ruby-gemset +0 -1
  76. data/.ruby-version +0 -1
  77. data/README.markdown +0 -121
  78. data/changelog.markdown +0 -94
  79. data/examples/authenticate.rb +0 -16
  80. data/examples/network.rb +0 -12
  81. data/examples/profile.rb +0 -18
  82. data/examples/sinatra.rb +0 -69
  83. data/examples/status.rb +0 -6
  84. data/lib/linked_in/api/query_methods.rb +0 -123
  85. data/lib/linked_in/api/update_methods.rb +0 -76
  86. data/lib/linked_in/client.rb +0 -31
  87. data/lib/linked_in/helpers.rb +0 -6
  88. data/lib/linked_in/helpers/authorization.rb +0 -106
  89. data/lib/linked_in/helpers/request.rb +0 -93
  90. data/spec/cases/api_spec.rb +0 -192
  91. data/spec/cases/linkedin_spec.rb +0 -37
  92. data/spec/cases/mash_spec.rb +0 -85
  93. data/spec/cases/oauth_spec.rb +0 -130
  94. data/spec/cases/search_spec.rb +0 -190
  95. data/spec/helper.rb +0 -30
@@ -0,0 +1,76 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people::(~,id=SDmkCxL2ya,url=http:%2F%2Fwww.linkedin.com%2Fin%2Fevanmorikawa)?oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - 34SXM1TL2I
27
+ X-Li-Uuid:
28
+ - nGYbNDLU7z0vrsnrySRY0A==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 23:03:51 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "_total": 3,
53
+ "values": [
54
+ {
55
+ "_key": "~",
56
+ "firstName": "Evan",
57
+ "id": "SDmkCxL2ya",
58
+ "lastName": "Morikawa"
59
+ },
60
+ {
61
+ "_key": "id=SDmkCxL2ya",
62
+ "firstName": "Evan",
63
+ "id": "SDmkCxL2ya",
64
+ "lastName": "Morikawa"
65
+ },
66
+ {
67
+ "_key": "url=http://www.linkedin.com/in/evanmorikawa",
68
+ "firstName": "Evan",
69
+ "id": "SDmkCxL2ya",
70
+ "lastName": "Morikawa"
71
+ }
72
+ ]
73
+ }
74
+ http_version:
75
+ recorded_at: Tue, 29 Jul 2014 23:03:52 GMT
76
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,70 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people::(~,url=http:%2F%2Fwww.linkedin.com%2Fin%2Fevanmorikawa)?oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - WNB6F3HNBU
27
+ X-Li-Uuid:
28
+ - iX9jFiyBzQoGwtCTHHS1OQ==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 23:08:26 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "_total": 2,
53
+ "values": [
54
+ {
55
+ "_key": "~",
56
+ "firstName": "Evan",
57
+ "id": "SDmkCxL2ya",
58
+ "lastName": "Morikawa"
59
+ },
60
+ {
61
+ "_key": "url=http://www.linkedin.com/in/evanmorikawa",
62
+ "firstName": "Evan",
63
+ "id": "SDmkCxL2ya",
64
+ "lastName": "Morikawa"
65
+ }
66
+ ]
67
+ }
68
+ http_version:
69
+ recorded_at: Tue, 29 Jul 2014 23:08:27 GMT
70
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/~/connections:(id,industry)?modified=new&modified-since=1388534400000&oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - 3IZXLVDQ7T
27
+ X-Li-Uuid:
28
+ - "/DQa2GyR0gWYc2ahxIiwMw=="
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 23:16:13 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "_count": 3,
53
+ "_start": 0,
54
+ "_total": 4,
55
+ "values": [
56
+ {
57
+ "id": "n-PxxuzcHK",
58
+ "industry": "Computer Software"
59
+ },
60
+ {
61
+ "id": "36WxGwKg_f",
62
+ "industry": "Financial Services"
63
+ },
64
+ {"id": "GhvKIIMzfH"}
65
+ ]
66
+ }
67
+ http_version:
68
+ recorded_at: Tue, 29 Jul 2014 23:16:14 GMT
69
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/id=SDmkCxL2ya/connections?modified=new&modified-since=1388534400000&oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - KTPQ1YMYZZ
27
+ X-Li-Uuid:
28
+ - 6x/YvsaGGF1OG1hXwg3XIQ==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 22:42:27 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "_count": 2,
53
+ "_start": 0,
54
+ "_total": 2,
55
+ "values": [
56
+ {
57
+ "firstName": "Evan",
58
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
59
+ "lastName": "Morikawa",
60
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
61
+ },
62
+ {
63
+ "firstName": "Evan",
64
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
65
+ "lastName": "Morikawa",
66
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
67
+ }
68
+ ]
69
+ }
70
+ http_version:
71
+ recorded_at: Tue, 29 Jul 2014 22:42:28 GMT
72
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/~/connections?modified=new&modified-since=1388534400000&oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - X6HW9ZFUD7
27
+ X-Li-Uuid:
28
+ - esTEJIA32QfNhIMK7LgYAg==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 22:42:16 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "_count": 2,
53
+ "_start": 0,
54
+ "_total": 2,
55
+ "values": [
56
+ {
57
+ "firstName": "Evan",
58
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
59
+ "lastName": "Morikawa",
60
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
61
+ },
62
+ {
63
+ "firstName": "Evan",
64
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
65
+ "lastName": "Morikawa",
66
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
67
+ }
68
+ ]
69
+ }
70
+ http_version:
71
+ recorded_at: Tue, 29 Jul 2014 22:42:17 GMT
72
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/id=SDmkCxL2ya?oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - AZ9S9N2EFV
27
+ X-Li-Uuid:
28
+ - kBv4Vd0YJ6k9BaMMu4l/xg==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 22:42:16 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "firstName": "Evan",
53
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
54
+ "lastName": "Morikawa",
55
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
56
+ }
57
+ http_version:
58
+ recorded_at: Tue, 29 Jul 2014 22:42:16 GMT
59
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/url=http:%2F%2Fwww.linkedin.com%2Fin%2Fevanmorikawa?oauth2_access_token=dummy_access_token&secure-urls=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Li-Format:
11
+ - json
12
+ User-Agent:
13
+ - Faraday v0.9.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - Apache-Coyote/1.1
25
+ X-Li-Request-Id:
26
+ - RO7WMW5H97
27
+ X-Li-Uuid:
28
+ - 1pXw+JTY4cNdoULsHPpsNA==
29
+ Vary:
30
+ - "*"
31
+ X-Li-Format:
32
+ - json
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Date:
36
+ - Tue, 29 Jul 2014 22:42:17 GMT
37
+ X-Li-Fabric:
38
+ - PROD-ELA4
39
+ Transfer-Encoding:
40
+ - chunked
41
+ Connection:
42
+ - keep-alive
43
+ X-Li-Pop:
44
+ - PROD-ELA4
45
+ Set-Cookie:
46
+ - lidc="b=LB66:g=95:u=37:i=1406657453:t=1406743853:s=2424976016"; Expires=Wed,
47
+ 30 Jul 2014 18:10:53 GMT; domain=.linkedin.com; Path=/
48
+ body:
49
+ encoding: UTF-8
50
+ string: |-
51
+ {
52
+ "firstName": "Evan",
53
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
54
+ "lastName": "Morikawa",
55
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
56
+ }
57
+ http_version:
58
+ recorded_at: Tue, 29 Jul 2014 22:42:18 GMT
59
+ recorded_with: VCR 2.9.2