Tweet old posts from a feed using Google Apps Script

This article will show you how to create a simple twitter app using Google Apps Script to randomly tweet posts from any specified feed URL. For example, it can be scheduled to automatically tweet a random article from your blog once a day. If you have a WordPress blog, then another solution is to use the Tweet Old Post plugin. However, no such plugin or gadget exists for Blogger, which is what prompted me to write this article. In addition, you can use this solution to post random articles from any feed for which you have the URL.

Here's the steps
  1. Copy the Google Spreadsheet that contains the sample code
  2. Register a new application with Twitter
  3. Update the sample code with your feed URL and twitter keys
  4. Test the application and optionally schedule it to run automatically

Calling a Web Service from Blogger using JSON-P and Google Apps Script

This article will give a simple example of how to write a web app with Google Apps Script, and then make a call to this from a page posted on your blog at Blogger. Since you can't host web apps on the same domain as your Blogger blog, you would normally be restricted from doing this by the same origin policy enforced by javascript. That is, javascript in a page on one domain cannot make remote calls to services running on another domain. This policy is enforced to prevent vulnerabilities called cross-site scripting.

But if you control both the content in your Blogger page, as well as the code of the web service, then there is a way to get around this using an approach called JSON with padding or JSONP. In this article I'll share a simple example which you can modify to solve more complex problems where you want to execute some server side function in Google Apps Script without the user leaving the page of your blog.