To only get the first description or anything else, you have a couple of options. You can change all of your variable lines to be something like this:

Code:
  if (<description> isin %t_temp && !%t_description) set %t_description $remove(%t_temp,<description>,</description>,$chr(9))


Then, just make sure you use your cleanup alias before running the script again. I'd suggest adding the !%t_variable part to everything you have if there is a chance they will appear more than once and if you only want the first one.

Or, you can just close the socket as soon as you see </status>:

Code:
  if (</status> isin %t_temp) sockclose twitter


That goes in your sockread event. It will close the socket as soon as the first status is read. It's the way I'd recommend unless you need something further down the XML file.

As far as replacing your @ and # words with colors, you can use this...

For any variable that will need those colored, use:

Code:
noop $regsub(%t_variable,/(@\w.*?\b)/g,04\1,%t_variable)
noop $regsub(%t_variable,/(#\w.*?\b)/g,04\1,%t_variable)


Replace the 04 with the color you want (line 1 is @ words and line 2 is # words). And replace %t_variable with your variable name(s) that you need. Note that the variable is in each line twice. Put these before any msg line.

** There may be a way to combine these into one command, but I'm not sure how. Maybe someone else knows and can explain how.

Last edited by Riamus2; 12/12/10 02:33 PM.

Invision Support
#Invision on irc.irchighway.net