Skip to content
deej Howard edited this page Jan 14, 2019 · 16 revisions

All of the client types supported by FeedSpora require some sort of authentication to allow automated posting by FeedSpora. Obviously, the first step to posting to any of these client types is to have a valid account on the associated service. The information about the authentication needed by FeedSpora and other useful client-specific information is detailed in the sections below:

Facebook

Facebook does not allow automated posting of any content to personal pages, per the Facebook Terms And Conditions. Automated posting to relevant Pages or Groups on Facebook is still supported, however. See Facebook's policies for Pages, Groups, and Events for more information.

The Facebook implementation uses the Facebook SDK. Authentication requires a token that is assigned by Facebook, which further requires definition and approval of an application. To set up an application, you will need to access the Facebook Developer website with your Facebook login. See the information on Facebook access tokens for more details on the Page Access Token and User Access Token types, and how to get them.

Posting To A Facebook Page

  • Requires a Page Access Token (and the user must have the manage_pages and publish_pages permissions for that page)
  • The Facebook Graph API Explorer can be used to generate a temporary page access token with the necessary permissions
  • FeedSpora requires the page id (included in the page's URL)

Posting To A Facebook Group

  • Requires a User Access Token (and the user must have the publish_to_groups permissions for that group)
  • Requires an approved application
  • Requires the group to install the application
  • FeedSpora requires the group page id (included in the group page's URL)

Twitter

Before FeedSpora can post to your Twitter account, you will first need to register the application. Follow the procedure below to register the application and get the necessary keys/tokens to provide to FeedSpora.

  1. If you don't already have one, you will need to create an account on the Twitter Developers website at https://developer.twitter.com

  2. When logged into your Twitter Developers account, access the Apps section of the website (currently, a pull-down under your account name in the upper right)

  3. Click the Create an app button, then provide the required information in the form presented

    • App name: A value of FeedSpora-<your_Twitter_login> is suggested
    • Application description: "A bot for posting tweets from RSS/Atom feeds"
    • Website URL: https://github.com/aurelg/feedspora is suggested
    • Tell us how this app will be used: "This app will be used to post tweets from an RSS/Atom feed to my Twitter account on a periodic basis."

    No other values are needed or should be selected. Click the Create button to continue.

  4. Review the Developer Terms, specifically the information regarding Automation, so you are fully aware of the expectations of how this app can/should be used on Twitter. Click the Create button to create the app.

  5. Access the app's Keys and tokens tab

    • There should already be two values under Consumer API keys, noted as (API key) and (API secret key)
    • In the Access token & access token secret section, click the Create button to create the (Access token) and (Access token secret)

    The four values above need to be specified in the FeedSpora configuration file for the TweepyClient specification

LinkedIn

Start by defining an application on the LinkedIn Developer Console. Provide appropriate values for all required fields.

Be sure and check the permissions for both

  • r_basicprofile (checked by default)
  • w_share

For the purposes of the examples below, add the OAuth 2.0 Authorized Redirect URLs as https://www.example.com/auth/linkedin.

Once the application has been created, values for both Client ID and Client Secret will be displayed. These values will be used in the steps below.

The first step is to get an authorization code. Do this by using a web browser to access the URL: https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=apps_client_id&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321, making sure to replace apps_client_id with your application's Client ID value. This will respond by presenting a screen where the application's request to access your LinkedIn profile can be accepted (or rejected). Once accepted, the browser is then redirected to the https://www.example.com/auth/linkedin URL, with additional parameters in the URL. Use the value of the code parameter in the command below.

Finally, to get an access token from the authorization code, execute the command below on the command line, being sure to replace authorization_code_from_URL_redirect with the code value from the browser redirect command above, apps_client_id with your application's Client ID, and apps_client_secret with your application's Client Secret.

curl -X POST --http1.1 "https://www.linkedin.com/oauth/v2/accessToken" --cookie "X-Csrf-Token: 987654321" -d "grant_type=authorization_code&code=authorization_code_from_URL_redirect&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&client_id=apps_client_id&client_secret=apps_client_secret" -H "Content-Type: application/x-www-form-urlencoded"

This command will produce a JSON response including the access_token value required by FeedSpora. Note that this access token has a limited lifetime and will need to be updated periodically.

Refer to the full LinkedIn authentication procedure for more details.

Diaspora

WordPress

The WordPress implementation applies to blogs hosted either at WordPress.com or at custom websites (via contributions from WordPress.org), and uses the WordPress XML-RPC API.

Mastodon

The Mastodon client is supported via the Mastodon.py library. Like many of the other clients supported by FeedSpora, Mastodon also requires registration of the FeedSpora client. This is easily accomplished by editing and executing two Python scripts that can be found in the ...client_extras/Mastodon sub-directory of the FeedSpora installation directory:

  1. Edit the 1_register_app.py file and change the value of api_base_url to the value of your Mastodon instance.
  2. Execute the modified file by running the command python 1_register_app.py (this will create a file named feedspora_clientcred.secret)
  3. Edit the 2_app_login.py file and change the value of
    • api_base_url to the value of your Mastodon instance (the same value as in step 1 above),
    • the value of [email protected] to the email address you use to log in to your Mastodon instance, and
    • the value of incrediblygoodpassword to the password you use to log in to your Mastodon instance
  4. Execute the modified file by running the command python 2_app_login.py (this will create a file named feedspora_usercred.secret)
  5. The two files that are produced from the above will contain the values you should use in your feedspora.yml configuration file for your Mastodon client credentials:
    • for client_id, use the value from the first line in the produced feedspora_clientcred.secret file
    • for client_secret, use the value from the second line in the produced feedspora_clientcred.secret file
    • for access_token, use the value in the produced feedspora_usercred.secret file

Shaarli