Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Monday, April 30, 2012

RoundTeam: Objective


Have you ever faced a situation that you'd like to share tweet with particular group of people, but don't want to follow each of them directly on Twitter?

What if you'd like to target your tweets to different Teams, not individual team members? Team is every group of people which has common interest(s), such as classmates, football team, neighbors, ornithologists of New York area, or any other.

Team members may come and leave, however Team stays the same. This is another reason to keep connection to the Team in general, not to each individual team member.

RoundTeam is free autoretweet service, a Twitter application, which invents a concept of a Twitter Team. Team is just an account from Twitter perspective, but it represents an interest or group of interests, not an individual person.

So, there are four simple steps to leverage Twitter in a new way:
  1. Choose existing or create new Twitter account to represent your team.
  2. Add this account to RoundTeam -- free online retweet service
  3. Specify what and from whom to retweet. It can be #hashtag, @mention, or just a keyword.
  4. Invite people to follow your Team on Twitter
Now every time there is new tweet on Twitter which matches the criteria of the Team, this tweet will be automatically retweeted. Thus all Team followers will see this tweet in their Twitter timeline (or even get an SMS on their cell phone).

Some of the benefits of this approach:
  • No need to follow each team member directly. Individuals may join and leave, commmunity tweets are still delivered to those who are interested.
  • This is better than Twitter "saved search" because saved search cannot send SMS to your mobile device once new tweet is available. Also saved search is something that each team member have to configure on their accounts.
RoundTeam mission is to create communities on Twitter. Such an islands of precisely targeted tweets in the world ocean of Twitter data.

Visit RoundTeam at http://roundteam.co

Sunday, November 20, 2011

Twitter @Anywhere and PHP Symfony. Implementing login action

While playing with the Twitter @Anywhere and PHP Symfony I have implemented "Sign in with Twitter" method for RoundTeam app (http://roundteam.co).

How it was done:

Creating a placeholder to represent "Sign in with Twitter" button.
mainpageSuccess.php:
<span id="login" class="twit_login">Sign in with Twitter</span>
I am not going to describe CSS part here.

Enabling Twitter connection using @Anywhere
javascript (rt.js):
$(document).ready(function() {
    twttr.anywhere(function(T) {
        $("#login").bind('click', function () {
            T.signIn();
        });
    }
Now when user clicks on "Sign in with Twitter" button he will be prompted to login using Twitter credentials. On this step "twitter_anywhere_identity" cookie is created (more details about this cookie and how to interpret it on server side see here: https://dev.twitter.com/docs/anywhere/welcome).

Okay, now we need to notify server that login has happened.
Here is one of the ways to implement this using PHP Symfony:

routing.yml
rt_get_user:
  url: /rt/user
  param: {module: connect, action: user}

action.class.php (for module "connect"):
public function executeUser(sfWebRequest $request) {
$cookie = $request->getCookie('twitter_anywhere_identity');
$this->logMessage('got auth request');
if ($cookie) {
$twitter_data = explode(':', $cookie);
$userId = $twitter_data[0];
$secret = $twitter_data[1];
$calculatedSecret = sha1($userId.RoundTeam_auth::SECRET);

if ($secret === $calculatedSecret) {
$this->logMessage('secret verified');
$userJson = $request->getParameter('user');
if ($userJson) {
$this->logMessage('user found!');
$user = json_decode($userJson);

$this->data = $user;

$this->logMessage($userJson);

$screenName = $this->data->screenName;
if (TeamTable::getInstance()->exists($screenName) == false) {
$this->logMessage('authenticated: '.$screenName);
$this->getUser()->signIn($this->data);
} else {
$this->logMessage('Failed to login using team: '.$this->$screenName, 'err');
}
} else {
$this->logMessage('user not found');
}
}
}
$this->redirect('@rt');
}

The last step is to post user data to server and reload page:

T.bind("authComplete", function (e, user) {
        post('rt/user', {user: JSON.stringify(user)}, function(response) {
        location.reload();
    });
});

That's it. Now user may login using his twitter credentials without leaving the round-team.com page. User data is passed to server and server authenticates user to enter.

It means that user stays logged in on both client side and server side. That said when you implement logout don't forget to log out user from server side:
$this->getUser()->setAuthenticated(false);
and client side:
twttr.anywhere.signOut();

Complete js code listing may be found on http://round-team.com

Saturday, April 2, 2011

Mozilla Firefox -- getting Social

Let me share my experience of how to make Mozilla Firefox more "social" browser. So it will keep you up-to-date with your communication channels, like social networks, mail accounts, news feeders etc.

Twitter, Facebook, LinkedIn

Yonoo plug-in for Firefox keeps me connected. Some features:
  • All updates in one line -- no more different tabs of several lines of updates. Twitter, Facebook, YouTube, LinkedIn and many other instant messengers/social networks feeds are listed in one place (being still distinguishable)
  • Minimum extra space -- when collapsed it costs me one small column to the left of the browser window. I use 11'inch laptop for my daily work, so, being concerned about every pixel, I am totally fine with this size
  • Simple yet flexible user interface
  • Amount of new items is shown even if main view is collapsed
  • Pop-up notifications in bottom-right corner of browser (may be turned off)

Google reader

I use Google Reader Watcher to stay updated with the latest news. Be careful not to install this plug-in instead.

What I don't like about this plug-in is that it is located in status bar thus not visible in full-screen mode. Well, it's still better than open a new tab.

Gmail

Have a look at Gmail Watcher. The only Gmail Firefox add-on which is installed into navigation bar (not status bar). Also, it doesn't require to enter login/password.

These add-ons all together provide me constant connectivity to the community.

If you have other cool socializing Firefox add-on to share -- please comment on this post!