Integrating WordPress with Twitter

Suppose I want to integrate my WordPress blog with Twitter or in other words I wish to tweet from my WordPress blog. I also want that my tweets on Twitter.com should appear as posts in my WordPress blog. For this purpose, I have chosen the Twitter Tools plugin by Crowd Favorite. You can have more information about this plugin from its site, http://crowdfavorite.com/wordpress/plugins/twitter-tools. On installing and activating this plugin, a message appears at the top of the Plugins page: Please update your Twitter Tools settings with a link to set the Twitter Tools options. Also in the Settings menu, one menu option is automatically added, Twitter Tools.  We can choose either way to set the Twitter Tools options. The Twitter Tools Options page appears as shown in below given figure. The page asks us to register our blog as an application on Twitter.com. The page also guides us about the options that we need to select in the registration page.

Twitter Tools Options page

The four blank boxes, Twitter Consumer Key, Twitter Consumer Secret, Access Token and Access Token Secret have to be filled with their respective values auto generated on registering our blog at Twitter.com. These values are required to make our plugin functional. So, let us proceed with the procedure of registering our blog by selecting the link, Twitter’s app registration page. This link navigates us to the Twitter Developer’s page where we are prompted to Sign In using our Twitter username and password. On entering a valid user name and password, we get a page to register our application. While registering our application, we can take the help of information displayed in above figure meant to guide us. Let us register our blog by entering the information as shown in below given figure.

Page to register our blog as an application at Twitter.com

On selecting the Register application button, we get a page displaying Twitter API Terms of Service. After reading the terms, we need to accept them to use the plugin. We get a page informing that our application has been registered successfully. The page also displays API key, Consumer Key and Consumer secret key. The page also displays a button, My Access Token that we select to get the Access Token and Access Token Secret values. We can copy and paste these auto-generated values in the respective boxes of Twitter Tools Options page (refer the first figure). After entering these values, we select the Connect to Twitter button to connect our WordPress blog to the Twitter.

The Twitter Tools Options displays a message confirming that our blog is connected to the Twitter. The Twitter Tools Options page displays a few more options to configure our plugin in detail. These options help us to:

  • determine whether to create a tweet when we post in our blog,
  • set the Tweet prefix for the new blog posts,
  • determine whether to create a blog post from our tweets,
  • select the category to assign to the tweet posts,
  • define tags for the tweet posts,
  • select an author for the tweet posts,
  • define the number of tweets to be shown in the sidebars, etc.

After choosing the desired options, we save them by selecting the Update Twitter Tools Options button. That is it; the Twitter Tools plugin is configured and fully functional. Now, if I tweet on Twitter.com (refer below given figure (a)), the tweet will appear as a blog post in our blog as shown in below given figure (b).

(a) Tweet at Twitter.com (b) Tweet appears in the form of post in the blog

Twitter Tools plugin adds an extra menu option, Tweet in Posts menu that can be used to create tweets when we post in our blog. On selecting the Tweet option from the Posts menu we get a Write Tweet page (below figure (a)) where we can write the message. The message not only appears as a blog post on our blog but also appears as a tweet on Twitter.com (below figure (b)).

(a) Writing Tweet in our blog (b) Tweet written in the blog appears in Twitter.com

To display our latest tweets and to tweet from our sidebars, we can make use of the Twitter Tools widget that is automatically added to the Widgets page on successful installation of the Twitter Tools plugin. So, let us open the Widgets page by selecting the Appearance->Widgets option from the main navigation menu and drag the Twitter Tools widget from the Available Widgets list and drop it on either of the sidebars. Let us set the title of the widget to My Tweets (below figure (a)) and select the Save button to save the widget. In our blog, we find that our latest tweets appear along with a textbox allowing us to tweet from our blog’s sidebars as shown in below given figure (b).

Note: The textbox to tweet appears in the sidebars only when the administrator is logged in.

(a) Options of Twitter Tools Widget (b) Latest tweets and textbox to tweet in the sidebars

For more information, refer my book, Blogging with WordPress 3 for Beginners available at Amazon.

One thought on “Integrating WordPress with Twitter

  1. Your book jQuery Recipes by Apress is perhaps the clearest most down to earth text I’ve ever encountered. Clear, concise, and lucid. The premise of the the “PROBLEM” / “SOLUTION” / “HOW IT WORKS” should be a standard when authoring Technology Texts. Any author who uses the term “oh this is so easy” or “thats simple” should remove those terms from his vocabulary. When you know something especially when you teach it one might think it s simple. To the uneducated, its like Everest, and uphill climbs. Thank you for not resorted to such terms.

    Finally, even though I am only on chapter 2, I hope to continue until completion, I would like to post a question. I have watched dozens of programming videos from all of the major outlets. Lynda, TutPlus, InfiteSkills etc. I continue to wrestle with the following systemic issue: Sometimes a var is within the function and sometimes outside a function. This is an issue of scope. Where can I find some skeletal reference that is like your book, problem, code, solution, rational. Any help you could provide with be awesome.

Leave a Reply

Your email address will not be published. Required fields are marked *