linkedin-oauth2 0.1.1 → 1.0.0

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.
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,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/id=SDmkCxL2ya/connections?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
+ - QIALXQGVUZ
27
+ X-Li-Uuid:
28
+ - gzwstUcqAOFj5DUjsA8d4Q==
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": 3,
53
+ "_start": 0,
54
+ "_total": 3,
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
+ "firstName": "Evan",
70
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
71
+ "lastName": "Morikawa",
72
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
73
+ }
74
+ ]
75
+ }
76
+ http_version:
77
+ recorded_at: Tue, 29 Jul 2014 22:42:27 GMT
78
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/~/connections?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
+ - ZAR1UE33AA
27
+ X-Li-Uuid:
28
+ - QAd8J1CChRMQNAnAqCsAAA==
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:20 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": 3,
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
+ "firstName": "Evan",
70
+ "headline": "Architect of Experience & Builder of Bits at Proximate",
71
+ "lastName": "Morikawa",
72
+ "siteStandardProfileRequest": {"url": "https://www.linkedin.com/profile/view?id=44799966&authType=name&authToken=sDyI&trk=api*a135643*s144016*"}
73
+ }
74
+ ]
75
+ }
76
+ http_version:
77
+ recorded_at: Tue, 29 Jul 2014 22:42:21 GMT
78
+ 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/~:(id,positions:(title))?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
+ - R50SHE3XIG
27
+ X-Li-Uuid:
28
+ - LYjWe4BMgZo4NuyQNuMsqA==
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
+ "id": "SDmkCxL2ya",
53
+ "positions": {
54
+ "_total": 9,
55
+ "values": [
56
+ {"title": "Architect of Experience | Builder of Bits"},
57
+ {"title": "Founder"},
58
+ {"title": "Hackstar"},
59
+ {"title": "Associate Product Manager Intern"},
60
+ {"title": "CEO & Co-Founder"},
61
+ {"title": "Software Development Intern"},
62
+ {"title": "Research Intern"},
63
+ {"title": "Software Intern"},
64
+ {"title": "Visualization Intern"}
65
+ ]
66
+ }
67
+ }
68
+ http_version:
69
+ recorded_at: Tue, 29 Jul 2014 22:42:28 GMT
70
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people/~:(id,industry)?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
+ - 6M4LBSVWWX
27
+ X-Li-Uuid:
28
+ - y0he9/xLJ9SeVFgQvNwufg==
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
+ "id": "SDmkCxL2ya",
53
+ "industry": "Internet"
54
+ }
55
+ http_version:
56
+ recorded_at: Tue, 29 Jul 2014 22:42:17 GMT
57
+ 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/~?lang=es&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
+ - GN6DOAQZK5
27
+ X-Li-Uuid:
28
+ - jDEfRwxRIGGM5ayYhr4KLw==
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:21 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:22 GMT
59
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.linkedin.com/v1/people::(~,id=SDmkCxL2ya):(id,industry)?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
+ - RI5PKGXAFZ
27
+ X-Li-Uuid:
28
+ - WX9aP0eStEKchVEI4BPf6g==
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:21 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
+ "id": "SDmkCxL2ya",
57
+ "industry": "Internet"
58
+ },
59
+ {
60
+ "_key": "id=SDmkCxL2ya",
61
+ "id": "SDmkCxL2ya",
62
+ "industry": "Internet"
63
+ }
64
+ ]
65
+ }
66
+ http_version:
67
+ recorded_at: Tue, 29 Jul 2014 22:42:22 GMT
68
+ 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::(~,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
+ - X930HJ00RK
27
+ X-Li-Uuid:
28
+ - EPPzVs9CO3ISpUUUaQ3JUw==
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:52 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": "id=SDmkCxL2ya",
62
+ "firstName": "Evan",
63
+ "id": "SDmkCxL2ya",
64
+ "lastName": "Morikawa"
65
+ }
66
+ ]
67
+ }
68
+ http_version:
69
+ recorded_at: Tue, 29 Jul 2014 23:03:53 GMT
70
+ recorded_with: VCR 2.9.2