Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1251 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Other Programming Languages :

Yahoo messenger bot?

Thread title: Yahoo messenger bot?
Closed Thread    
    Thread tools Search this thread Display Modes  
02-09-2007, 11:34 PM
#1
bscdesign_com is offline bscdesign_com
Status: I'm new around here
Join date: Nov 2006
Location:
Expertise:
Software:
 
Posts: 20
iTrader: 0 / 0%
 

bscdesign_com is on a distinguished road

  Old  Yahoo messenger bot?

A potential client wants me to build him a website and he needs a script that knows when his moddles are signed into Yahoo messenger. I haven't the slightes clue how to do this. Can any one help? I am a perl/cgi programmer.

02-09-2007, 11:51 PM
#2
Matsta is offline Matsta
Matsta's Avatar
Status: Insert Rave Here
Join date: Dec 2006
Location: Auckland, NZ
Expertise:
Software:
 
Posts: 1,426
iTrader: 3 / 100%
 

Matsta is on a distinguished road

Send a message via AIM to Matsta Send a message via MSN to Matsta

  Old

Hmm um you'd have to find the Yahoo APi, thought msn and yahoo dont really like then making 3rd party extensions though

02-10-2007, 12:20 AM
#3
Imac is offline Imac
Status: Member
Join date: Feb 2007
Location: Earth....
Expertise:
Software:
 
Posts: 328
iTrader: 8 / 100%
 

Imac is on a distinguished road

Send a message via ICQ to Imac Send a message via MSN to Imac

  Old

Simple HTML


<img src="http://opi.yahoo.com/online?u=IDHERE&m=g&t=0" width="12" height="12" border=0><a href="ymsgr:sendIM?IDHERE">IDHERE</a>

02-10-2007, 12:59 AM
#4
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Yes, you can query Yahoo for anyone's online status. Here's a Perl script that I wrote ages ago (I don't know Perl much at all, so it's probably not ideal).

Code:
#!/www/perl/bin/perl

use LWP::Simple;
use URI::Escape;

# If no querystring provided (for username), exit.
if (length ($ENV{'QUERY_STRING'}) == 0) {
	print "Content-type:text/html\n\n";
	print "Please specify whose online status you want to check.";
	exit;
}

# Yahoo! URL to query
$URL = "http://opi.yahoo.com/online?m=text&u=";

# Get username from querystring (lowercase and strip spaces)
$username = lc(uri_unescape($ENV{'QUERY_STRING'}));
$username =~ s/\s+//g;

# Fetch content from Yahoo!
$content = get($URL . $username);


# Begin output
print "Content-type:text/html\n\n";
if (index($content, "NOT ONLINE") == -1)
{
	# Do something if user is online
	print $username . " is ONLINE";
}
else
{
	# Do something if user is offline
	print $username . " is  OFFLINE";
}

02-10-2007, 01:19 AM
#5
Matsta is offline Matsta
Matsta's Avatar
Status: Insert Rave Here
Join date: Dec 2006
Location: Auckland, NZ
Expertise:
Software:
 
Posts: 1,426
iTrader: 3 / 100%
 

Matsta is on a distinguished road

Send a message via AIM to Matsta Send a message via MSN to Matsta

  Old

Hmm is that exactly what he wants?

02-10-2007, 07:04 AM
#6
bscdesign_com is offline bscdesign_com
Status: I'm new around here
Join date: Nov 2006
Location:
Expertise:
Software:
 
Posts: 20
iTrader: 0 / 0%
 

bscdesign_com is on a distinguished road

  Old

Thanks Salathe that looks like what I was looking for.

I have some questions though.

I am planning on pulling the the usernames from a database and using while to display all of the information for each model in a loop.

Code:
# Yahoo! URL to query
$URL = "http://opi.yahoo.com/online?m=text&u=";
Can I add the username from the database to the url so that u=USERNAME ? And then

Code:
$content = get($URL);

Thanks

02-10-2007, 04:07 PM
#7
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Sure, I just concatenated the base URL ($URL) and the username ($username) together in the get function call for simplicity. My example used the query string for ease of use (it fit my needs when I wrote it) but tying it in with a database loop doesn't affect the method of retrieving the status from Yahoo!

02-10-2007, 10:27 PM
#8
bscdesign_com is offline bscdesign_com
Status: I'm new around here
Join date: Nov 2006
Location:
Expertise:
Software:
 
Posts: 20
iTrader: 0 / 0%
 

bscdesign_com is on a distinguished road

  Old

Ok.

Thanks for everything.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed