|
| Author |
Message |
drdreff Newbie

Joined: 13 May 2004 Posts: 20
  
|
Posted: Tue Jan 11, 2005 10:44 am Post subject: |
|
|
The pain of AOL and the stain on my soul has driven me to start moving my bot to a more controllable environment.
Im using Net::Jabber now and I'm having troble creating html formatted messages. The spec says it can be done, but there's not any examples.
Has anyone used Net::Jabber to send html? |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Tue Jan 11, 2005 12:46 pm Post subject: |
|
|
I've tested having my bot send HTML to me, but it just shows the actual HTML code and not rendering it. _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
drdreff Newbie

Joined: 13 May 2004 Posts: 20
  
|
Posted: Tue Jan 11, 2005 4:08 pm Post subject: |
|
|
| XMPP Allows for the format to be transmit, but I don't think that Net::Jabber has the code required to support it. Net::XMPP is not that different so maybe we're both looking at the wrong libs. |
|
| Back to top |
|
 |
drdreff Newbie

Joined: 13 May 2004 Posts: 20
  
|
Posted: Tue Jan 18, 2005 8:25 am Post subject: |
|
|
FWIW the way to do this is to craft your own jabber format message and send it using XMLStream's Send().
The Net::Jabber MessageSend has too many limitations to allow for arbitrary xml to be sent.
So I build up a string like:
| Code: | | <br /><html xmlns="http://www.w3.org/1999/xhtml"><br /> <body><br /> <!-- XHTML-Basic Message here--><br /> </body><br /></html><br /> |
and later wrap + send it like:
| Code: | | <br /> $Connection->Send( '<message to="'.$who.'" type="chat">'.<br /> '<body>Trillian</body>'.$body.'</message>'<br /> );<br /> |
Given some extra time and dedication to the task I will use the XML functions to build up that message, but the Send() fires a string down the connection, so you can't just pass it an object anyway.
So there's the answer |
|
| Back to top |
|
 |
|