Solved

Net-XMPP / Google Talk

Posted on 2007-03-28
5
1,500 Views
Last Modified: 2012-06-21
Could someone who knows Perl much better than I give me a code snippet that uses the Net-XMPP package to connect to Google Talk, send a message, and then disconnect? So far I haven't even been able to connect, let alone send a message. I've used the code shown below, but when I execute it, after a bit of waiting, it returns an error message: "No SASL mechanism found". Also, I understand well what the hostname, username, and password are, but what on earth is the "resource" parameter?

    #!/usr/local/bin/perl
    use Net::XMPP;
   
    $Con = new Net::XMPP::Client();
   
    $Con->Execute(hostname=>"talk.google.com",
        username=>"username@gmail.com",
        password=>"password",
        resource=>"i don't know what this means"
    );
   
    $Con->Disconnect();
0
Comment
Question by:soapergem
  • 2
5 Comments
 
LVL 8

Expert Comment

by:nedfine
ID: 18814065
please ensure that the following modules are installed
IO ::Socket ::SSL (>=0.81 ?)
XML ::Stream
Net ::XMPP
Authen ::SASL

not too sure abt this.
0
 
LVL 6

Author Comment

by:soapergem
ID: 18930120
Those modules are installed. (Sorry for the delay in responding, by the way.) Now, about the question: what does the "resource" variable do? And how would I properly code something to send a message?
0
 
LVL 8

Expert Comment

by:nedfine
ID: 18930541
0
 
LVL 3

Accepted Solution

by:
javanesevn earned 500 total points
ID: 26569304
Hello Soapergem,

Gtalk is implemented XMPP protocol *BUT* they do customize from their own requirement.
So, if you would like to make a connection with their server please refer this rule http://code.google.com/apis/talk/open_communications.html

To help your make clear about resource  please read core protocol for more detail http://www.ietf.org/rfc/rfc3920.txt

Here is quick answer about resource. When you make a connection to xmpp server you should be set a resource or resource identifier to help server detect particular connection from client. Because from an account you can login to server by from other devices ( client application, mobile, web...etc), resource will help server routing traffic and delivery message.
You can set any name you like, if nothing is set some server will generate a random resource for client.

Regards,
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL Web Database 5 110
add a syntax to a csv file 8 98
How to generate square thumbnail using perl 13 77
html form to write data to csv 24 95
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now