How to click on a link on another website?

So I first call a function on tumblr which finds the href relative to the classes “high_res_link”:

function link_to_flickr() {
var href = [];
$('.high_res_link').not('.no_pop').eac…
var h = $(this).attr('href') + "sizes/h/";
href.push(h);
});
alert(href[0]);
}

And now for the hard bit that I don’t understand how to do.

I want to be able to call this function on that url href[0]:

function flickr(){
var heyho = $('a:contains("Download the")').attr('href');
if (($('div:contains("(1600 x")').length > 0) && (heyho.toString().length > 2)) {
window.open(heyho, '_blank');
}
else {
alert("ERROR");
}
}

Using some cross domain? some $.getJSON() ? Any ideas?