diff options
| -rw-r--r-- | services/Makefile | 3 | ||||
| -rw-r--r-- | services/googleoauth.json | 12 | ||||
| -rw-r--r-- | services/googleshortener.json | 1 | ||||
| -rw-r--r-- | services/linkedin/Makefile | 34 | ||||
| -rw-r--r-- | services/linkedin/communications.json | 25 | ||||
| -rw-r--r-- | services/linkedin/companies.json | 103 | ||||
| -rw-r--r-- | services/linkedin/groups.json | 218 | ||||
| -rw-r--r-- | services/linkedin/jobs.json | 83 | ||||
| -rw-r--r-- | services/linkedin/linkedin.png | bin | 0 -> 190123 bytes | |||
| -rw-r--r-- | services/linkedin/network.json | 66 | ||||
| -rw-r--r-- | services/linkedin/oauth.json | 38 | ||||
| -rw-r--r-- | services/linkedin/people.json | 135 | ||||
| -rw-r--r-- | utils/spore2dot.pl | 19 |
13 files changed, 724 insertions, 13 deletions
diff --git a/services/Makefile b/services/Makefile index 0ad6339..93e1298 100644 --- a/services/Makefile +++ b/services/Makefile @@ -4,6 +4,7 @@ SPORE2DOT := perl ../utils/spore2dot.pl check: spore_validation.rx @make -C github check @make -C googlemaps check + @make -C linkedin check @$(VALIDATOR) amazons3.json @$(VALIDATOR) backtweet.json @$(VALIDATOR) backtype.json @@ -40,6 +41,7 @@ png: \ twitter.png @make -C github png @make -C googlemaps png + @make -C linkedin png %.png : %.dot dot -T png -o $@ $< @@ -50,4 +52,5 @@ png: \ clean: @make -C github clean @make -C googlemaps clean + @make -C linkedin clean -rm *.png *.dot spore_validation.rx diff --git a/services/googleoauth.json b/services/googleoauth.json index e57dd56..1103030 100644 --- a/services/googleoauth.json +++ b/services/googleoauth.json @@ -5,9 +5,6 @@ "get_request_token" : { "path" : "/OAuthGetRequestToken", "method" : "GET", - "headers" : { - "authorization" : "OAuth oauth_consumer_key=\":oauth_consumer_key\", oauth_signature_method=\":oauth_signature_method\", oauth_signature=\":oauth_signature\", oauth_timestamp=\":oauth_timestamp\", oauth_nonce=\":oauth_nonce\", oauth_version=\":oauth_version\", oauth_callback=\":oauth_callback\"" - }, "required_params" : [ "scope" ], @@ -20,9 +17,6 @@ "post_request_token" : { "path" : "/OAuthGetRequestToken", "method" : "POST", - "headers" : { - "authorization" : "OAuth oauth_consumer_key=\":oauth_consumer_key\", oauth_signature_method=\":oauth_signature_method\", oauth_signature=\":oauth_signature\", oauth_timestamp=\":oauth_timestamp\", oauth_nonce=\":oauth_nonce\", oauth_version=\":oauth_version\", oauth_callback=\":oauth_callback\"" - }, "form-data" : { "scope" : ":scope", "xoauth_displayname" : ":xoauth_displayname" @@ -52,18 +46,12 @@ "get_access_token" : { "path" : "/OAuthGetAccessToken", "method" : "GET", - "headers" : { - "authorization" : "OAuth oauth_consumer_key=\":oauth_consumer_key\", oauth_token=\":oauth_token\", oauth_verifier=\":oauth_verifier\", oauth_signature_method=\":oauth_signature_method\", oauth_signature=\":oauth_signature\", oauth_timestamp=\":oauth_timestamp\", oauth_nonce=\":oauth_nonce\", oauth_version=\":oauth_version\"" - }, "expected_status" : [ 200, 400 ], "authentication" : true }, "post_access_token" : { "path" : "/OAuthGetAccessToken", "method" : "POST", - "headers" : { - "authorization" : "OAuth oauth_consumer_key=\":oauth_consumer_key\", oauth_token=\":oauth_token\", oauth_verifier=\":oauth_verifier\", oauth_signature_method=\":oauth_signature_method\", oauth_signature=\":oauth_signature\", oauth_timestamp=\":oauth_timestamp\", oauth_nonce=\":oauth_nonce\", oauth_version=\":oauth_version\"" - }, "expected_status" : [ 200, 400 ], "authentication" : true } diff --git a/services/googleshortener.json b/services/googleshortener.json index 9acf010..6cb586a 100644 --- a/services/googleshortener.json +++ b/services/googleshortener.json @@ -27,7 +27,6 @@ "method" : "GET", "optional_params" : [ "key", - "oauth_token", "projection", "start-token" ], diff --git a/services/linkedin/Makefile b/services/linkedin/Makefile new file mode 100644 index 0000000..f48c51e --- /dev/null +++ b/services/linkedin/Makefile @@ -0,0 +1,34 @@ + +VALIDATOR := perl ../../utils/validator.pl --schema spore_validation.rx --description +SPORE2DOT := perl ../../utils/spore2dot.pl + +check: spore_validation.rx + @$(VALIDATOR) oauth.json + @$(VALIDATOR) people.json + @$(VALIDATOR) groups.json + @$(VALIDATOR) companies.json + @$(VALIDATOR) jobs.json + @$(VALIDATOR) network.json + @$(VALIDATOR) communications.json + +test: check + +spore_validation.rx: + wget http://github.com/SPORE/specifications/raw/master/spore_validation.rx + +png: linkedin.png + +%.png: %.dot + dot -T png -o $@ $< + +linkedin.dot: \ + people.json \ + groups.json \ + companies.json \ + jobs.json \ + network.json \ + communications.json + $(SPORE2DOT) $^ > $@ + +clean: + -rm *.png *.dot spore_validation.rx diff --git a/services/linkedin/communications.json b/services/linkedin/communications.json new file mode 100644 index 0000000..d66e2f7 --- /dev/null +++ b/services/linkedin/communications.json @@ -0,0 +1,25 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "send_message" : { + "path" : "/v1/people/~/mailbox", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + }, + "send_invitation" : { + "path" : "/v1/people/~/mailbox", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "Communications" + } +} diff --git a/services/linkedin/companies.json b/services/linkedin/companies.json new file mode 100644 index 0000000..a2ce8e5 --- /dev/null +++ b/services/linkedin/companies.json @@ -0,0 +1,103 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "company_by_id" : { + "path" : "/v1/compagnies/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "company_by_name" : { + "path" : "/v1/companies/universal-name=:name:selector", + "method" : "GET", + "required_params" : [ + "name", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "search_company" : { + "path" : "/v1/company-search:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "keywords", + "hq-only", + "facet", + "facets", + "start", + "count", + "sort", + "format" + ], + "expected_status" : [ 200 ] + }, + "my_followed_companies" : { + "path" : "/v1/people/~/following/companies:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + }, + "follow_company" : { + "path" : "/v1/people/~/following/companies", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + }, + "unfollow_company" : { + "path" : "/v1/people/~/following/companies/id=:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + }, + "suggestion_companies" : { + "path" : "/v1/people/~/suggestions/to-follow/companies:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + }, + "company_products" : { + "path" : "/v1/companies/:id/products:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "Companies" + } +} diff --git a/services/linkedin/groups.json b/services/linkedin/groups.json new file mode 100644 index 0000000..826dda2 --- /dev/null +++ b/services/linkedin/groups.json @@ -0,0 +1,218 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "group_by_id" : { + "path" : "/v1/groups/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "my_group_memberships" : { + "path" : "/v1/people/~/group-memberships:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "membership-state", + "format" + ], + "expected_status" : [ 200 ] + }, + "show_group_setting" : { + "path" : "/v1/people/~/group-memberships/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "change_group_setting" : { + "path" : "/v1/people/~/group-memberships/:id", + "method" : "PUT", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "join_group_by_id" : { + "path" : "/v1/people/~/group-memberships/:id", + "method" : "PUT", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "join_group" : { + "path" : "/v1/people/~/group-memberships", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + }, + "leave_group" : { + "path" : "/v1/people/~/group-memberships/:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + }, + "show_posts" : { + "path" : "/v1/groups/:id/posts:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "start", + "count", + "order", + "role", + "category", + "modified-since", + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "post_by_id" : { + "path" : "/v1/posts/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "show_comments" : { + "path" : "/v1/posts/:id/comments:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "start", + "count", + "order", + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "create_post" : { + "path" : "/v1/groups/:id/posts", + "method" : "POST", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "like_post" : { + "path" : "/v1/posts/:id/relation-to-viewer/is-liked", + "method" : "PUT", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "follow_post" : { + "path" : "/v1/posts/:id/relation-to-viewer/is-following", + "method" : "PUT", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "flag_post" : { + "path" : "/v1/posts/:id/category/code", + "method" : "PUT", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "delete_post" : { + "path" : "/v1/posts/:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + }, + "comment_by_id" : { + "path" : "/v1/comments/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "add_comment" : { + "path" : "/v1/posts/:id/comments", + "method" : "POST", + "required_payload" : true, + "required_params" : [ + "id" + ], + "expected_status" : [ 201 ] + }, + "delete_comment" : { + "path" : "/v1/comments/:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + }, + "suggestion_groups" : { + "path" : "/v1/people/~/suggestions/groups:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + }, + "remove_group_suggestion" : { + "path" : "/v1/people/~/suggestions/groups/:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "Groups" + } +} diff --git a/services/linkedin/jobs.json b/services/linkedin/jobs.json new file mode 100644 index 0000000..906004a --- /dev/null +++ b/services/linkedin/jobs.json @@ -0,0 +1,83 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "job_by_id" : { + "path" : "/v1/jobs/:id:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "search_job" : { + "path" : "/v1/job-search:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "keywords", + "company-name", + "job-title", + "country-code", + "postal-code", + "distance", + "facet", + "facets", + "start", + "count", + "sort", + "format" + ], + "expected_status" : [ 200 ] + }, + "my_bookmarked_jobs" : { + "path" : "/v1/people/~/job-bookmarks:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + }, + "bookmark_job" : { + "path" : "/v1/people/~/job-bookmarks", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + }, + "unbookmark_job" : { + "path" : "/v1/people/~/job-bookmarks/:id", + "method" : "DELETE", + "required_params" : [ + "id" + ], + "expected_status" : [ 204 ] + }, + "suggestion_jobs" : { + "path" : "/v1/people/~/suggestions/job-suggestions:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "Jobs" + } +} diff --git a/services/linkedin/linkedin.png b/services/linkedin/linkedin.png Binary files differnew file mode 100644 index 0000000..76da206 --- /dev/null +++ b/services/linkedin/linkedin.png diff --git a/services/linkedin/network.json b/services/linkedin/network.json new file mode 100644 index 0000000..09c31ff --- /dev/null +++ b/services/linkedin/network.json @@ -0,0 +1,66 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "my_network_updates" : { + "path" : "/v1/people/~/network/updates", + "method" : "GET", + "optional_params" : [ + "scope", + "type", + "count", + "start", + "after", + "before", + "show-hidden-members", + "format" + ], + "expected_status" : [ 200 ] + }, + "network_updates_by_id" : { + "path" : "/v1/people/id=:id/network/updates", + "method" : "GET", + "required_params" : [ + "id" + ], + "optional_params" : [ + "scope", + "type", + "count", + "start", + "after", + "before", + "show-hidden-members", + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "my_network_stats" : { + "path" : "/v1/people/~/network/network-stats", + "method" : "GET", + "optional_params" : [ + "format" + ], + "expected_status" : [ 200 ] + }, + "post_update" : { + "path" : "/v1/people/~/person-activities", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + }, + "add_shares" : { + "path" : "/v1/people/~/shares", + "method" : "POST", + "required_payload" : true, + "expected_status" : [ 201 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "Network" + } +} diff --git a/services/linkedin/oauth.json b/services/linkedin/oauth.json new file mode 100644 index 0000000..3259391 --- /dev/null +++ b/services/linkedin/oauth.json @@ -0,0 +1,38 @@ +{ + "version" : "0.1", + "base_url" : "https://api.linkedin.com", + "methods" : { + "get_request_token" : { + "path" : "/uas/oauth/requestToken", + "method" : "GET", + "expected_status" : [ 200, 400 ], + "authentication" : true + }, + "get_access_token" : { + "path" : "/uas/oauth/accessToken", + "method" : "GET", + "expected_status" : [ 200, 400 ], + "authentication" : true + }, + "authorize_token" : { + "path" : "/uas/oauth/authorize", + "method" : "GET", + "required_params" : [ + "oauth_token" + ], + "expected_status" : [ 302 ] + }, + "invalidate_token" : { + "path" : "/uas/oauth/invalidateToken", + "method" : "GET", + "expected_status" : [ 200, 400 ], + "authentication" : true + } + }, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "OAuth" + } +} diff --git a/services/linkedin/people.json b/services/linkedin/people.json new file mode 100644 index 0000000..04cf1b8 --- /dev/null +++ b/services/linkedin/people.json @@ -0,0 +1,135 @@ +{ + "version" : "0.1", + "base_url" : "http://api.linkedin.com", + "methods" : { + "my_profile" : { + "path" : "/v1/people/~:selector", + "method" : "GET", + "headers" : { + "Accept-Language" : ":lang" + }, + "required_params" : [ + "selector" + ], + "optional_params" : [ + "format", + "lang" + ], + "expected_status" : [ 200 ] + }, + "profile_by_id" : { + "path" : "/v1/people/id=:id:selector", + "method" : "GET", + "headers" : { + "Accept-Language" : ":lang" + }, + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "format", + "lang" + ], + "expected_status" : [ 200, 404 ] + }, + "profile_by_url" : { + "path" : "/v1/people/url=:url:selector", + "method" : "GET", + "headers" : { + "Accept-Language" : ":lang" + }, + "required_params" : [ + "url", + "selector" + ], + "optional_params" : [ + "format", + "lang" + ], + "expected_status" : [ 200, 404 ] + }, + "search_people" : { + "path" : "/v1/people-search:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "keywords", + "first-name", + "last-name", + "company-name", + "current-company", + "title", + "current-title", + "school-name", + "current-school", + "country-code", + "postal-code", + "distance", + "facet", + "facets", + "start", + "count", + "sort", + "format" + ], + "expected_status" : [ 200 ] + }, + "my_connections" : { + "path" : "/v1/people/~/connections:selector", + "method" : "GET", + "required_params" : [ + "selector" + ], + "optional_params" : [ + "start", + "count", + "modified", + "modified-since", + "format" + ], + "expected_status" : [ 200 ] + }, + "connections_by_id" : { + "path" : "/v1/people/id=:id/connections:selector", + "method" : "GET", + "required_params" : [ + "id", + "selector" + ], + "optional_params" : [ + "start", + "count", + "modified", + "modified-since", + "format" + ], + "expected_status" : [ 200, 404 ] + }, + "connections_by_url" : { + "path" : "/v1/people/url=:url/connnections:selector", + "method" : "GET", + "required_params" : [ + "url", + "selector" + ], + "optional_params" : [ + "start", + "count", + "modified", + "modified-since", + "format" + ], + "expected_status" : [ 200, 404 ] + } + }, + "authentication" : true, + "authority" : "http://github.com/SPORE", + "name" : "LinkedIn", + "meta" : { + "documentation" : "http://developer.linkedin.com/", + "module" : "People" + } +} diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl index f7e0e7e..e522099 100644 --- a/utils/spore2dot.pl +++ b/utils/spore2dot.pl @@ -34,6 +34,7 @@ if ($has_interface) { } +my $MAX_LEN = 90; my %meth; foreach my $spec (@specs) { my $name = $spec->{meta}->{module} || $spec->{name}; @@ -46,29 +47,47 @@ foreach my $spec (@specs) { $meth{$name} = 1; my $desc = $spec->{methods}->{$name}; print $name, "("; + my $len = length $name; my $first = 1; if ($desc->{required_payload}) { print "payload"; + $len += 7; $first = 0; } for (@{$desc->{required_params}}) { print ", " unless $first; + $len += 2; + if ($len > $MAX_LEN) { + print "\\l "; + $len = 4; + } print $_; + $len += length $_; $first = 0; } if ($desc->{optional_params}) { print " " unless $first; } for (@{$desc->{optional_params}}) { + if ($len > $MAX_LEN) { + print "\\l "; + $len = 4; + } print "\\["; print ", " unless $first; print $_, "\\]"; + $len += 4 + length $_; $first = 0; } if ($desc->{optional_payload}) { + if ($len > $MAX_LEN) { + print "\\l "; + $len = 4; + } print "\\["; print ", " unless $first; print "payload\\]"; + $len += 11; $first = 0; } if ($desc->{unattended_params} || $spec->{unattended_params}) { |
