WordPressの記事をTwitterへ自動投稿・連携

WPの記事投稿時に連携してTwitterへ自動で投稿してくれるプラグインをご紹介。

プラグイン「NextScripts: Social Networks Auto-Poster」

概要

アイキャッチ(またはデフォルト画像を設定可能)、記事タイトル、本文抜粋、タグまでも自動で投稿してくれます。

ダウンロード

NextScripts: Social Networks Auto-Poster

設定手順

1.プラグインダウンロード・インストール

上記URLからDLまたは、WP管理画面のプラグイン検索から「NextScripts: Social Networks Auto-Poster」をキーワード検索してインストール・有効化をします。

2.プラグイン設定の前に「Twitter App」でアプリ登録

1.「Twitter Developper」または「Twitter」 へ、アプリ管理・自動投稿をしたいTwitterアカウントでサインインします。

画面右上の「Sign In」より、アプリ管理・自動投稿をしたいTwitterアカウントでログインします。

2.「Twitter Apps」 へアクセスします。

画面右上の「Create New App」ボタンをクリックします。

3. Appの設定

「Create an application」の画面にてApp設定

Name:任意のアプリ名

Description:アプリの概要を入力

Website:連携・自動投稿させたいWPのURL

Callback URL:基本敵には「Website」と同一のもの

「Developer Agreement」のagree:同意してチェックを入れる

最後に「Create your Twitter application」ボタンをクリックします。

「Your application has been created. Please take a moment to review and adjust your application’s settings.」と表示されれば、ここまでは成功です。

「Permissions」画面にて権限設定

続いて「Permissions」タブをクリックして、パーミッション(権限)周りを設定します。

「Read and Write」がチェックされていれば問題ありません。
もし入っていなければ、チェックして最後に「Update Settings」ボタンをクリックします。

「Keys and Access Tokens」画面にて各種情報を取得

次に「Keys and Access Tokens」タブをクリックして、画面下部の「Create my access token」ボタンをクリックします。

 

「Status
Your application access token has been successfully generated. It may take a moment for changes you’ve made to reflect.
Refresh if your changes are not yet indicated.」と表示されれば成功です。

 

最後に、上記の完了画面内に表示されている「API Key」「API Secret」「Access Token」「Access Token Secret」をメモしておきます。

後程のプラグイン設定に必要な情報です。

3.プラグインの設定:アカウント

設定画面:SNAP: SNAP Accounts

左サイトナビゲーションの「SNAP|AutoPoster」か、プラグイン一覧内の「設定」をクリックすると、プラグイン設定画面(Accounts)へ移動します。

「Add new account」をクリックすると、対象ネットワークを選択するポップアップが表示されるので「Twitter」を選択します。

Twitterの情報を入力

Twitterのネットワーク設定画面が表示されるので、先ほど取得した各種情報を入れていきます。

■Account Nickname:当プラグインでの管理上の名前(任意のものでOK)

■Your Twitter URL:自動投稿するTwitterのURL
例)https://twitter.com/WeblifeNavi

■API Key:Twitter Apps で取得した「API Key」

■API Secret:Twitter Apps で取得した「API Secret」

■Access Token:Twitter Apps で取得した「Access Token」

■Access Token Secret:Twitter Apps で取得した「Access Token」

■Message Format:自動投稿のフォーマットを入力できます

↓使用できるフォーマットタグ

%TITLE% – Inserts the Title of the post,
%URL% – Inserts the URL of the post,
%SURL% – Inserts the shortened URL of your post,
%IMG% – Inserts the featured image URL,
%EXCERPT% – Inserts the excerpt of the post (processed),
%RAWEXCERPT% – Inserts the excerpt of the post (as typed),
%ANNOUNCE% – Inserts the text till the <!–more–> tag or first N words of the post,
%FULLTEXT% – Inserts the processed body(text) of the post,
%RAWTEXT% – Inserts the body(text) of the post as typed,
%TAGS% – Inserts post tags,
%CATS% – Inserts post categories,
%HTAGS% – Inserts post tags as hashtags,
%HCATS% – Inserts post categories as hashtags,
%AUTHORNAME% – Inserts the author’s name,
%SITENAME% – Inserts the the Blog/Site name.

例)
%TITLE%|%SITENAME%
%URL%
#%CATS% %HTAGS%

■Attach Image to the Post:自動投稿に画像・アイキャッチを挿入したい場合はチェック

最後に「Add Account」ボタンをクリックして、下記のように追加されていれば完了です。

4.プラグインの設定:セッティング

設定画面:SNAP: SNAP Settings

基本的にはデフォルトのままで構いませんが、カスタム投稿を使用していたり、権限周りをいじっている場合は調整が必要です。

■How to make auto-posts

[自動投稿の設定・スケジュール]

 

Publish Immediately – No WP Cron will be used. Choose if WP Cron is disabled or broken on your website:
→WP Cron が使えない場合はこちら

Use WP Cron to Schedule autoposts – Recommended for most sites. Faster Performance – requires working WP Cron:
→通常はこちら

Limit autoposting speed – Recommended for busy sites with a lot of new posts.
Do not autopost more then one post per network every
[ ]Days, [ ]Hours, [ ]Minutes.
Randomize posting time ±[ ]Minutes
What to do with the rest of the posts if there are more posts then daily limit?
Skip/Discard/Don’t Autopost
Schedule for tomorrow – Not recommended, may cause significant delays
→WP Cron の自動投稿タイミングを調整したい場合はここで調整

■User Privileges/Security

[ユーザ権限別の設定]

サイトへ投稿するユーザーアカウントが、複数の権限に与えられている場合はここで調整します。

 

Skip User Security Verification. NOT Recommended, but useful in some situations. This will allow autoposting for everyone even for the non-existent users.
→セキュリティ検証をスキップしてユーザ全員の投稿を自動投稿させる場合はこちら

Who can make autoposts without seeing any auto-posting options?
[オートポストオプションを見ずにオートポストを作成できるのは誰ですか?]
管理者 – Somebody who has access to all the administration features
編集者 – Somebody who can publish and manage posts and pages as well as manage other users’ posts, etc.
投稿者 – Somebody who can publish and manage their own posts
寄稿者 – Somebody who can write and manage their posts but not publish them
購読者 – Somebody who can only manage their profile
→自動投稿対象権限を調整

Who can see auto-posting options on the “New Post” and “Edit Post” pages and make autoposts?
[「新しい投稿」と「投稿の編集」ページに自動投稿オプションが表示され、自動ポストを作成できるのは誰ですか?]
管理者 – Somebody who has access to all the administration features
編集者 – Somebody who can publish and manage posts and pages as well as manage other users’ posts, etc.
投稿者 – Somebody who can publish and manage their own posts
寄稿者 – Somebody who can write and manage their posts but not publish them
購読者 – Somebody who can only manage their profile
→自動投稿対象権限を調整

■Interface

How to show the Networks List in the “Add New Network” dropdown :
[[新しいネットワークの追加]ドロップダウンリストにネットワークリストを表示する方法]

Categorized – Please show supported networks with categories
Plain – Please don’t confuse me, just show the plain list

How to show list of networks on the “Add New Post” page:
[[新しい投稿を追加]ページでネットワークの一覧を表示する方法]

CollapsedCollapsed.
Expanded.
Show checked networks expanded and unchecked collapsed.
Hide unchecked and filtered out networks Helps to remove clutter from “New post” page.

■Autoposting Filters

You can setup general criteria for what posts should be autoposted
[自動投稿する投稿の一般的な基準を設定できます]

カスタム投稿タイプを使用していたり、カテゴリやタグ、作成者(Author)でフィルターした場合はここで調整します。

Filter Posts (Only posts that meet the following criteria will be autoposted)
Categories and Tags >>
Post Type, Post Format >>
Author >>

■URL Shortener

Please use %SURL% in “Message Format” to get shortened urls or check “Force Shortened Links”.
[短縮されたURLを取得するには、「メッセージフォーマット」で%SURL%を使用するか、「短縮リンクを強制する」をチェックしてください。]

短縮URLを使用した自動投稿を行いたい場合はここで調整します。

■Auto-Import comments from Social Networks

Plugin will automatically grab the comments posted on Social Networks and insert them as “Comments to your post”. Plugin will check for the new comments every hour. 
[プラグインは自動的にソーシャルネットワーク上に掲示されたコメントをつかみ、それらをあなたの投稿へのコメントとして挿入します。プラグインは1時間ごとに新しいコメントをチェックします。]

SNS(今回はTwitter)でコメントされたものをWPのコメントにインポートします。

Twitterの場合はBotの自動返信のパターンがあるので、この機能の使用は危険かもしれません。

■URL Parameters

Here you can set what should be done to backlinks.
[ここでは、バックリンクに対して何をすべきかを設定できます。]

■Auto-HashTags Settings

How to generate hashtags if tag is longer then one word 
[タグが1ワードより長い場合にハッシュタグを生成する方法]

■%ANNOUNCE% tag settings

Plugin will take text untill the <!–more–> tag. Please specify how many characters should it get if <!–more–> tag is not found
[プラグインは<!–more–>タグまでテキストを取ります。<!–more–>タグが見つからない場合に取得する文字数を指定してください]

■”Open Graph” Tags

SNAP has a very simple implementation of the “Open Graph” metatags. Please see here for more info – SNAP Open Graph Tags
“All In One SEO Pack” plugin has been detected It has support for OG Metatags. Please disable SNAP OG Tags to avoid conflicts.

[SNAPには、 “Open Graph”メタタグの非常に簡単な実装があります。詳細はこちら – SNAP Open Graph Tags
“All In One SEO Pack”プラグインが検出されました。これはOG Metatagsをサポートしています。競合を避けるために、SNAP OGタグを無効にしてください。]

All In One SEO Pack プラグインを使用している場合、補足案内が表示されます。

■Advanced “Featured” Image Settings

自動投稿時の画像処理がうまくいかなかった場合の、予備の設定。

■Alternative “Featured Image” location

アイキャッチが設定されていない記事の場合の、自動投稿に使用するデフォルト画像の設定

■System Settings

デバッグやエラーレポート等の設定。

 

最後に「Update Setteings」ボタンをクリックして、完了となります。