Thursday, 26 June 2014

Change Twitter into a Gmail

I am willing to share a little project on Gmail I've been working on this weekend. The idea is that you can turn your Twitter timeline into a Gmail Notifier and get notified (via tweets) as soon as new emails in your mailbox. 
And since you can link Twitter to your phone, you can even receive SMS alerts for new Gmail messages on your mobile phone with the help of Twitter. No programming is required and can be up and running in 5 minutes.
Connecting Gmail and Twitter via Google Docs 

Gmail offers an RSS feed in your mailbox, but the big problem is that if you have to self-publish this RSS feed on Twitter, you need to give your account information to Google in text format. It is not done. 
My solution (edit) using OAuth with Google Apps Script to link your Gmail and Twitter, so you do not have to share their passwords with anyone. You have a spreadsheet with Google Docs that monitors your Gmail mailbox in the background, for example, every 5 minutes. As soon as a new message (s) detected in the mailbox, send a tweet using their own Twitter app. It is the big picture, but here's how you can implement: 
Step A: Create a new Gmail app for Twitter 

Go to twitter.com / signup and create a new Twitter account to your Gmail inbox - mine is called myGmailInbox. 
Confirm your email address, open the configuration page for Twitter and check "Protect my tweets" and uncheck "Let others find me at my email address." This is necessary because you do not want search engines or any other user of Twitter, tweets Gmail to read your tweets, even if it only has the subject line. 
Go to dev.twitter.com log in using his new Twitter account and use the following values ​​to create a new Twitter application. [Name = Gmail; Description = Gmail Bot; Http :/ / goo.gl / ldAXX web = site; The callback URL = https://spreadsheets.google.com/macros] 
Make sure there are no empty spaces in the address fields including Twitter can give a warning "Invalid URL format". Accept the terms, fill in the CAPTCHA and send the form to create your first application of Twitter. 
Then go to the Settings tab on the Twitter application and change the mode of "access" to "read only" to "read and write", which we would like to publish tweets to Google Docs. 
Save the settings and switch to the tab that says OAuth Tool and note the key consumer and consumer secret key. 
Step B: Link Google Docs and Twitter 

Go to Google Docs and make a copy of this worksheet in your own Docs account. 
Under Tools -> Script Editor, change values ​​and TWITTER_CONSUMER_SECRET TWITTER_CONSUMER_KEY with their fair values. 
Go to Resources -> triggers the current script and create a new timed event for "sendTweet" that activates every 5 minutes. 
Save the trigger and then click Authorize (the Access Grant) for this script can automatically read Gmail inbox in periodically to check for new mail. 
Go to Run -> SendTweet and will display a different message "Permission Required" on Twitter. Click on Authorize -> Authorize App for Google Apps Script post tweets to your Twitter account Gmail. 
Step C: Follow Gmail on Twitter 

Sign in to your Twitter account age and submit a request to follow your new Gmail account on Twitter. 
Log into your Gmail account and approve "Request to follow." 
And we're done. You should now see the tweets for new Gmail messages when they come into the main timeline. 
Receive SMS alerts for new Gmail 

To receive SMS alerts on your phone for new Gmail messages, simply open the Twitter profile page of your bot and turn Mobile Gmail Notifications. This will obviously only work if it is connected (and verified) on mobile phone with its main Twitter account. 
One more thing. By default, the sequence of commands Google searches, Gmail inbox for all incoming mails and tweets as soon as you find a new message in the mailbox. 
If this results in too many tweets (or SMS messages), you can specify a different filter search, Gmail and receive notifications only for messages that interest you. You must change the value of GMAIL_SEARCH_STRING on line # 18.

No comments: