Social Update
Authomatically send updates to Twitter and Facebook when ExpressionEngine entry is published.
Installation
Upload 'social_update' and 'shorteen' folders to your 'third_party' folder. When you install Social Update module, Shorteen will also be installed authomatically.
Settings
To start using Social Update, you need to provide settings for the module in Control Panel.
To get your site authorized for Twitter posts, enter your Consumer Key and Consumer Secret for Twitter API. If you don't have API key & secret, you can obtain them here: https://dev.twitter.com/apps/new. The application Access level should be set to "Read and write". Make sure you specify something as callback URI in Twitter app settings. Though it will be overridden, this field should not be empty.
After you enter those, click 'Authorize' button below. You will be redirected to Twitter page asking to authorize your site. After you confirm, fields for Access token and Token secret will be filled with appropriate values. Click 'Save' button at the bottom to save token and token secret.
To get your site authorized for Facebook posts, enter your Application ID and Secret Key for Facebook API. If you don't have API App ID & secret, you can obtain them here: http://developers.facebook.com/setup/.
After you enter those, click 'Authorize' button below. You will be redirected to Facebook page asking to authorize your site. After you confirm, Access token will be authomatically entered with appropriate values. If you administer several pages on Facebook, you are able to choose where you want to post. Do not forget to lick 'Save' again to save that value.
To get your site authorized for LinkedIn posts, enter your API Key and Secret Key for LinkedIn API. If you don't have API App ID & secret, you can obtain them here: https://www.linkedin.com/secure/developer.
After you enter those, click 'Authorize' button below. You will be redirected to LinkedIn page asking to authorize your site. After you confirm, Access token will be authomatically entered with appropriate values. Click 'Save' button at the bottom to save token and token secret.
You also have to provide the desired service you would like to use for links shortening. For detailed shortening setup, go to Shorteen module settings.
By default, update to social network is sent when entry is published/saved with "open" status. However you can select multiple trigger statuses in module settings.
You'll need to click "Save" each time after authorizing a social network.
If you want to reset tokens to empty values, clean up API key pair field and click Authorize.
Usage
Social Update create new tab on entry publish/edit page in Control Panel.
On that tab, you are able to provide text that will posted to Twitter and/or Facebook when the entry is first saved with 'open' status. If the text is not entered, then update to social network is not sent.
The link to entry page is included authomatically and is shortened (with the help of Shorteen module). You are able to specify how your URLs are formed - based on URL Title, Entry ID or Pages or Structure module (if installed). Channel settings are taken into consideration.
You can also choose to not include entry link with the message.
Template tags
Use {exp:social_update:data} tag to display data of posts to social networks for given entry.
{exp:channel:entries}
{if no_results}
<p>No such entry</p>
{/if}
<h1>{title}</h1>
{exp:social_update:data entry_id="{entry_id}"}
{if no_results}
<p>No posts to social networks</p>
{/if}
{if facebook_post}
<p><a href="{post_link}">Facebook post</a> ({post_date format="%Y-%m-%d"}):
<em>{post_text}</em></p>
{/if}
{if twitter_post}
<p><a href="{post_link}">Tweet</a> ({post_date format="%Y-%m-%d"}):
<em>{post_text}</em></p>
{/if}
{/exp:social_update:data}
{/exp:channel:entries}
Tag parameters:
- entry_id — the ID of entry to fetch associated social posts data. Required.
Conditional variables:
- {if no_results}{/if} — displayed if there are no posts data to show
- {if twitter_post}{/if} — displayed if current data row represents Twitter post
- {if facebook_post}{/if} — displayed if current data row represents Facebook post
Single variables:
- post_link — the link to post on social network
- post_id — the ID of post on social network
- post_text — the text that has been posted to Twitter/Facebook
- post_date format="%Y-%m-%d" — the date when post has been made. Standard EE date formatting rules apply.