So, my script is ok apart the link part. Its a jquery twitter feed script that pulls in my tweets.
The links its generates through regex should be – http://twitter.com – Instead it come out as http://www.mydomain.com/http://twitter.com – which obv doesnt work.
To clarify – When a twitter feed comes through that has a text link in it – the regex turns it into a proper link but puts the pages current url in front of it.
<script language="JavaScript">
$.getJSON("https://twitter.com/statuses/user_timeline.json screen_name=twitternamehere&count=2&callback=?",
function(data){
$.each(data, function(i,item){
ct = item.text;
mytime = item.created_at;
var strtime = mytime.replace(/(\+\S+) (.*)/, '$2 $1')
var mydate = new Date(Date.parse(strtime)).toLocaleDateString();
var mytime = new Date(Date.parse(strtime)).toLocaleTimeString();
ct = ct.replace(/http:\/\/\S+/g, '<a href="$&" target="_blank">$&</a>');
ct = ct.replace(/\s(@)(\w+)/g, ' @<a href="http://twitter.com/$2" target="_blank">$2</a>');
ct = ct.replace(/\s(#)(\w+)/g, ' #<a href="http://search.twitter.com/search?q=%23$2" target="_blank">$2</a>');
$("#tweetRow").append("<div class='container'><div class='date'> "+mydate+" "+mytime+" </div><div class='tweet'> "+ct+" </div></div>");
});
$('.container:last').addClass('container2');
});
</script>
Hope this helps!!