Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Warren,
I have a tweet with two @links, the first one gets turned into a link by your "FormatURLS" function but the second one just stays as plain text.
Cheers,
Chris
Oh no, I've told warren ages ago about that, did even sent him some code to replace multiple @'s. Guess he didn't really like my code :p
This works, of course you could hide the functionality within your DLL if you prefer or just use this XSLT.
This will work for:
URL's ( both HTTP & HTTPS )@names#Tags ( Links to the Twitter search page )
In your main template where you want to output the encoded text you put this call-template:
<xsl:call-template name="formaturl"> <xsl:with-param name="url" select="text"/></xsl:call-template>
Then the template it calls is:
<xsl:template name="formaturl"> <xsl:param name="url"/> <xsl:variable name="transform-http" select="Exslt.ExsltRegularExpressions:replace($url, '(http\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-https" select="Exslt.ExsltRegularExpressions:replace($transform-http, '(HTTps\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-AT" select="Exslt.ExsltRegularExpressions:replace($transform-https, '(^|\s)@(\w+)',ig,' <a href="http://www.twitter.com/$2">@$2</a>')"/> <xsl:variable name="transform-HASH" select="Exslt.ExsltRegularExpressions:replace($transform-AT, '(^|\s)#(\w+)',ig,' <a href="http://www.twitter.com/search?q=$2">#$2</a>')"/> <xsl:value-of select="$transform-HASH" disable-output-escaping="yes"/> </xsl:template>
I hope that helps :)
I have just submitted a patched version of the code for Warren to publish, so this issue should be fixed very soon :)
Yep I have seen Chris's patch for this and in the process of implemeting, testing & packaging up.
Will be out tomorrow :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Allow support for multiple links within Tweets :)
Hi Warren,
I have a tweet with two @links, the first one gets turned into a link by your "FormatURLS" function but the second one just stays as plain text.
Cheers,
Chris
Oh no, I've told warren ages ago about that, did even sent him some code to replace multiple @'s. Guess he didn't really like my code :p
Hi Warren,
This works, of course you could hide the functionality within your DLL if you prefer or just use this XSLT.
This will work for:
URL's ( both HTTP & HTTPS )
@names
#Tags ( Links to the Twitter search page )
In your main template where you want to output the encoded text you put this call-template:
Then the template it calls is:
I hope that helps :)
Cheers,
Chris
I have just submitted a patched version of the code for Warren to publish, so this issue should be fixed very soon :)
Cheers,
Chris
Yep I have seen Chris's patch for this and in the process of implemeting, testing & packaging up.
Will be out tomorrow :)
is working on a reply...