GoTwitr - Twitter Automation Site Built with Drupal
Whether it's for pleasure or business, or both, Twitter automation is a must for anyone who wants to use Twitter effectively. GoTwitr is a new site whose primary goal is to make it easy for people to grow and manage their Twitter communities.
It’s also a tool to help new Twitter users get started quickly and easily. GoTwitr’s unique invitation model makes it extremely easy for any Twitter user to get his friends and family connected to Twitter. GoTwitr uses a unique new concept to deliver quality followers, and promote you to other twitter users that share common interests and passions.
GoTwitr was built in Drupal 6. Drupal’s external site integration tools made it easy to bypass the normal Drupal registration and login and use the “Login with Twitter” service.
GoTwitr Technology
GoTwitr uses Twitter’s Oauth API, which means the Drupal registration is 100% automated. This is a first for Twitter Automation sites. Using this technology lets you experience all the advanced automation tools without sharing your Twitter username and password with the site (which can be risky).
For the actual Twitter integration, we tested several Drupal Twitter modules, but ended up using Jaisen Mathai’s excellent EpiTwitter and EpiOauth php library. It uses CURL to make calls to Twitter asynchronously, so it was blazingly fast, and very easy to turn into a Drupal custom module.
Why No Drupal Registration or Login Form?
Since GoTwitr is only useful for working with your Twitter account, we decided to fully automate the Drupal login and registration process by using data from Twitter. This means you can register or sign into the GoTwitr website with a single click. To accommodate this process, the following three functions were used.
First, a call is made to twitter_sign_in() which loads our Twitter API keys and sends them to Twitter. The bulk of the work is done in twitter_validate() which is called by Twitter during the Oauth validation. The call to getAccessToken() returns an individual's security tokens from Twitter, and a single call to get_accountVerify_credentials() not only validates you on Twitter, but it returns the complete Twitter user record in the $response variable. Now, with your Twitter UID we can use user_external_load($token->user_id) to see if you are a current Drupal registered user. If you are a current user, you are immediately logged into the site using user_external_login($account), however if this is your first visit a call is made to new_gotw_account() where a Drupal registration is performed on your behalf using the data Twitter sent us in the $response variable.
No Long Registration Form to Fill Out! Yeah!
