XHR requests to Issuu do not get a response. (Classic ASP)

230 Views Asked by At

I look after two auction websites for customer that also use Issuu to publish digital version of their catalogues. Within the past 48hrs both have reported that the sites are no longer displaying the links to the Issuu version of the catalogues. Both use the same method to test to see if a catalogue is available on Issuu, sending a XHR head request from the webserver (both sites sit on the same server) and if I get a response, then the site swaps in the link.

Here's the code, it's classic ASP and it worked perfectly until a few days ago and works for other sites that I have tested, e.g. Google, MS, my own website, just not Issuu.

Any ideas?

Code follows....

Function InsertIssuuLink(s_saleno)

'$! Looks for designated folder on remote site 
dim xmlhttp
dim s_targetURL
dim s_tmp

InsertIssuuLink = ""

s_saleno = trim(s_saleno)

s_targetURL = "http://issuu.com/artcurialbpt/docs/" & s_saleno & ""

'$! Create instance of Server XHR object

set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")

'$! Perform header request - most efficient way of determining if folder / item is present

xmlhttp.open "HEAD", s_targetURL, true

xmlhttp.send

'$! Ignore errors - better for page to finish loading without link than to throw an error
On Error Resume Next

'$! Wait the waitForResponse no of seconds if we've not gotten the data yet (readyState = 4 : request completed)
If xmlhttp.readyState <> 4 then

    xmlhttp.waitForResponse 5

End If  

If Err.Number <> 0 then

    InsertIssuuLink = ""

Else    


    If (xmlhttp.readyState <> 4) Or (xmlhttp.Status <> 200) Then
        'Abort the XMLHttp request
        xml.Abort
        InsertIssuuLink = ""

    Else

        InsertIssuuLink = "<a href=""" & s_targetURL & "?e=6268161/"" onclick=""pageTracker._trackPageview ('/outgoing/issuu/" & s_saleno & "');window.open(this.href);return false;"">Consulter le E-Catalogue</a><br />"
        b_show_catalogue_section = true

    End If

End If      


End Function
0

There are 0 best solutions below