Create a new application on LinkedIn Developer.
- make sure "Live Status" is "Development"
- make sure "OAuth User Agreement" -> "Default Scope" includes "rw_groups"
Make note of the following:
- API Key
- Secret Key
- OAuth User Token
- OAuth User Secret
In order to proceed, you'll need to determine the id for every group you wish to post to.
Generally, you can visit the group itself and look for "gid=xxx" in the URL.
See this or this for relevant discussion.
The POST body is pretty straightforward. Generally, you'll want to create something similar with a "content" element to share a URL. See the Developer API Docs for example output.
post = {
'title' => 'New Group Discussion',
'summary' => 'What does everyone think about platform development?',
'content' => {
'submitted-url' => 'http://developer.linkedin.com/forum',
'submitted-image-url' => 'http:/www.example.com/linkedin.png',
'title' => 'Build the Professional Web with LinkedIn',
'description' => 'A great resource for finding documentation and answers related to developing on the LinkedIn Platform'
}
}
- set
api_key=
,api_secret=
,user_token=
anduser_secret=
with your application keys from step 1 - populate
gids = []
with your group ids from step 2 - populate
post = {}
with your post DATA from step 3 - run the script
You are now free to move about the cabin.