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 = [];
var h = $(this).attr('href') + "sizes/h/";

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)) {, '_blank');
else {

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