Thursday, January 29, 2009
Gears comes to Gmail
Wednesday, January 21, 2009
MoMo Jan 2009
Mobile Monday meet/event for Jan 2009 is being held on 28 January 2009, from 6:30pm onwards at Sasken office. The registration is free but the number is limited, so rush for it.
The schedule is
- Talk by Ashish Sinha on "Is Voice the King of VAS?"
- Demo of VoicePHP by Yusuf Motiwala, CEO of Tringme.
All the details including registration can be done here...
Friday, January 09, 2009
set facebook user status
If you are familiar with facebook (or for that matter, any one of the gazillion social networking applications out there), there is a way for a user to set his status - any random string. Just like one can set a custom message on his favorite IM client.
One of my friend was exploring the facebook REST api's and was trying to set the status via the REST api. Now facebook has a peculiar feature where for certain functionality, the service adds additional security and needs additional permissions. Now, setting of the status is one such api that needs additional permission. And my friend was finding it hard to figure out how to get the permission using the REST apis. There are means to get the permission if you develop for/on the facebook platform. I too did take a look at the perl facebook api module but got fed up.
#!/usr/bin/perl -w
use strict;
use warnings;
use HTTP::Cookies;
use LWP::UserAgent;
my $email;
my $password;
my $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6'; # whatever...
#print "Please enter FB email for login\n";
$email = $ARGV[0]; #read the login e-mail
#print "Please enter FB password\n";
$password= $ARGV[1]; #read the password
print "Thanks\n";
chomp($email); #remove last line
chomp($password);
my %postLoginData; #necessary post data for login
$postLoginData{'email'}=$email;
$postLoginData{'pass'}=$password;
$postLoginData{'persistent'}=1;
$postLoginData{'login'}='Login';
our $response; #holds the response the HTTP requests
#set the headers, let's make this a Firefox browser!
my @header = ('Referer'=>'http://www.facebook.com', 'User-Agent'=>$user_agent);
our $cookie_jar = HTTP::Cookies->new(file=>'fbkCookies.dat',autosave=>1, ignore_discard=>1);
our $browser = LWP::UserAgent->new; #init browser
$browser->cookie_jar($cookie_jar);
# incase you are behind a proxy
# $browser->proxy(['http', 'https'], 'http://127.0.0.1:9876/');
$browser->get('http://www.facebook.com/login.php',@header);
#here we actually login!
$response = $browser->post('https://login.facebook.com/login.php',\%postLoginData,@header);
#was login successful?
if($response->content =~ /Incorrect Email/) {
print "Login Failed...Quitting..\n";
}
else {
print "..and we are in!\n";
#let's go to the homepage
$response = $browser->get('http://www.facebook.com/home.php',@header);
$response->content =~ /
Labels: Perl