{"id":83,"date":"2009-03-23T06:45:00","date_gmt":"2009-03-23T06:45:00","guid":{"rendered":"http:\/\/digitalsrc.com\/blog\/how-to-integrate-twitter-with-blogs\/"},"modified":"2013-04-21T12:45:47","modified_gmt":"2013-04-21T12:45:47","slug":"how-to-integrate-twitter-with-blogs","status":"publish","type":"post","link":"https:\/\/digitalsrc.com\/blog\/how-to-integrate-twitter-with-blogs\/","title":{"rendered":"How To Integrate Twitter With Blogs ?"},"content":{"rendered":"<p>Twitter is undoubtedly the most popular micro-blogging platform today and is extremely popular among bloggers, internet marketers and other web savvy people. Twitter has also been an effective source in driving traffics to blog and marketers have been using this pretty effectively. There are already tools in the market that would automatically get new posts from your blog feeds and post them to Twitter under your profile.<\/p>\n<p>While this might be an easy way for you to present your blog post to the Twitterati, people soon realize that these are automated messages and tends to ignore them. Also, not 100% of your posts are good, but with this even the most silliest ones are posted on Twitter which tends to do more harm to your reputation than any good.<\/p>\n<p>However, if you really want to use Twitter the way it should be and want your readers to Twit your good posts, you can do that as well. Just integrate some small code snippets in your blog and you are done.<\/p>\n<p><span>Integrating Twitter with WordPress Blogs<\/span><\/p>\n<p><span>Method 1<\/span><\/p>\n<p>Step 1: Open the header.php file of WordPress and insert the following lines just before the closing tag.<\/p>\n<p><!--more--><\/p>\n<hr \/>\n<p><code><!--?php if ( is_single() ) { ?--><br \/>\n<script charset=\"utf-8\" type=\"text\/javascript\" src=\"http:\/\/bit.ly\/javascript-api.js?version=latest&amp;login=tweettrackjs&amp;apiKey=R_7e9987b2fd13d7e4e881f9cbb168f523\">\/\/ <![CDATA[\n\n\/\/ ]]><\/script><br \/>\n<script charset=\"utf-8\" type=\"text\/javascript\" src=\"http:\/\/s.bit.ly\/TweetAndTrack.js?v=1.01\">\/\/ <![CDATA[\n\n\/\/ ]]><\/script><br \/>\n<!--?php } ?--><\/code><\/p>\n<hr \/>\n<p>Step 2: Open the single.php file and insert the following line just below the_content() function.<\/p>\n<hr \/>\n<p><code><a onclick=\"return TweetAndTrack.open(this, '&lt;?php echo get_permalink();?&gt;');\" href=\"#\"><br \/>\n<span style=\"display: none;\">Reading: <!--?php the_title();?--><\/span><br \/>\nTweet This: Send Page to Twitter<\/a><\/code><\/p>\n<hr \/>\n<p><span>Method 2<\/span><\/p>\n<p>You can use the Plugin offered by Twit This. It&#8217;s really really good and easy to use however, it would require the users to give their Twitter user id and password.<\/p>\n<p><span><br \/>\nIntegrating Twitter with Blogger Blogs ( Blogspot )<\/span><\/p>\n<p>Twitter with Blogger Widget Templates<\/p>\n<p>a) Go to Blog layout and then click Edit HTML. You will see a link for &#8220;Expand Widget template&#8221; , Click on it.<\/p>\n<p>b) Copy the entire code and save it in a notepad for backup. Never ever do any tweak to your widget templates without taking a proper backup, they can be pretty messy to fix once you break them.<\/p>\n<p>c) Find the line that has got the class post-footer in the XML template.<\/p>\n<p>d) Copy the code below and paste it near the class<\/p>\n<hr \/>\n<p><code><br \/>\n<script charset=\"utf-8\" type=\"text\/javascript\" src=\"http:\/\/bit.ly\/javascriptapi.js?version=latest&amp;login=tweettrackjs&amp;&lt;br&gt;apiKey=R_7e9987b2fd13d7e4e881f9cbb168f523\">\/\/ <![CDATA[\n\n<script charset='utf-8' src='http:\/\/s.bit.ly\/TweetAndTrack.js?v=1.01' type='text\/javascript'\/>\n<a expr:onclick='&quot;return TweetAndTrack.open(this, \\&quot;&quot; + data:post.url +\n&quot;\\&quot;);&quot;' href='#'>\n<span style='display:none;'>Check This: <data:post.title\/><\/span>Twit This<\/a>  <\/b:if><\/code>\n\n\n\n\n\n<hr>\n\n\n\n\n<strong>\nIntegrating Twitter with Blogger Classic Template ( Blogspot)<\/strong>a) Go to the templates tab in the blogger dashboard\n\nb) Copy and paste the existing template code in a notepad for backup. These templates are relatively easy to fix but why take a chance ?\n\nc) Find the lines\n\n\n\n\n\n<hr>\n\n\n\n\n<code>\n\n\n\n<div class=\"post\">\n\n\n<h2><a href=\"<$BlogItemPermalinkURL$>\" title=\"permalink\">\n<$BlogItemTitle$><\/a><\/code>\n\n\n\n\n\n<hr>\n\n\n\n\n\nd) Paste the code below beside this. This will get the \"Twit This\" link to appear beside your blog post title.\n\n\n\n\n\n\n<hr>\n\n\n\n\n<code><ItemPage>\n<a href='javascript:(function(){TwitThisPop=window.open\n(%22http:\/\/twitthis.com\/twit?url=%22+encodeURIComponent(location.href)+%22&amp;\ntitle=%22+((document.title)%20?%20encodeURIComponent(document.title.replace\n(\/^\\s*|\\s*$\/g,%27%27))%20:%20%22%22),%20%22TwitThisPop%22,%20%22width=600,\n%20height=500,%20location,%20status,%20scrollbars,\n%20resizable,%20dependent=yes%22);\n%20setTimeout\n(%22TwitThisPop.focus()%22,%20100);%20})()'>Twit This<\/a><\/ItemPage><\/code>\n\n\n\n\n\n<hr>\n\n\n\n\n\ne) If you want to put the Twit This link after the post , paste the code just below\n\n\n\n\n\n\n<hr>\n\n\n\n\n<code>\n\n\n\n<div class=\"text\"><$BlogItemBody$><\/code>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<span>Points to Note:<\/span>\na) The code above would get the Twit This link only on your individual post pages and not on your blog home page. This is done in this way because the code picks up the URL of the current page and if this code appears on the home page of your blogger blog it would post the home page URL to Twitter when someone clicks on it but the post might move from the home page after a week and visitors ollowing the Twitter link would not find the proper content.\n\nb) The blogger classic template is using the TwitThis service and would require visitors to put in their user id and password while posting to Twitter.\n\n<span>Related post: <a href=\"http:\/\/digitalsrc.com\/blog\/seo-for-blogspot-blog-new-blogger\/\">SEO for Blogspot - Blogger Blogs<\/a><\/span>\n\/\/ ]]><\/script><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twitter is undoubtedly the most popular micro-blogging platform today and is extremely popular among bloggers, internet marketers and other web savvy people. Twitter has also been an effective source in driving traffics to blog and marketers have been using this pretty effectively. There are already tools in the market that would automatically get new posts [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[56,339],"tags":[203,205,121,206,204],"_links":{"self":[{"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/posts\/83"}],"collection":[{"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":0,"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"wp:attachment":[{"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalsrc.com\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}