Solved

Net-XMPP / Google Talk

Posted on 2007-03-28
5
1,497 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

12 Experts available now in Live!

Get 1:1 Help Now