Skip to content

Instantly share code, notes, and snippets.

@CootCraig
Created February 12, 2011 19:56
Show Gist options
  • Save CootCraig/824060 to your computer and use it in GitHub Desktop.
Save CootCraig/824060 to your computer and use it in GitHub Desktop.
Read Life cell file
r = 'http://www.conwaylife.com/pattern.asp?p=acorn_106.lif';
$.ajax(r,{
crossDomain: true,
success: function(data, textStatus, jqXHR){
coot.log('ajax success');
},
error: function(jqXHR, textStatus, errorThrown){
coot.log('ajax fail [' + typeof jqXHR + ']');
}
});
// output
jqXHR
Object { readyState=4, status=302, statusText="error"}
➜ crockford_js_the_good_parts git:(master) ✗ wget -d http://www.conwaylife.com/pattern.asp?p=bargespaceship_106.lif
wget -d http://www.conwaylife.com/pattern.asp\?p\=bargespaceship_106.lif
DEBUG output created by Wget 1.12 on linux-gnu.
--2011-02-12 12:49:20-- http://www.conwaylife.com/pattern.asp?p=bargespaceship_106.lif
Resolving www.conwaylife.com... 65.182.101.250
Caching www.conwaylife.com => 65.182.101.250
Connecting to www.conwaylife.com|65.182.101.250|:80... connected.
Created socket 3.
Releasing 0x08aba240 (new refcount 1).
---request begin---
GET /pattern.asp?p=bargespaceship_106.lif HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: www.conwaylife.com
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Connection: keep-alive
Date: Sat, 12 Feb 2011 19:49:21 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Content-Disposition: attachment;filename=bargespaceship_106.lif
Content-Length: 1205
Content-Length: 1205
Content-Type: application/octet-stream; Charset=ISO-8859-1
Expires: Wed, 02 Feb 2011 19:49:20 GMT
Cache-control: no-cache
---response end---
200 OK
Registered socket 3 for persistent reuse.
Length: 1205 (1.2K) [application/octet-stream]
Saving to: `pattern.asp?p=bargespaceship_106.lif.1'
100%[======================================>] 1,205 --.-K/s in 0s
2011-02-12 12:49:21 (63.6 MB/s) - `pattern.asp?p=bargespaceship_106.lif.1' saved [1205/1205]
➜ crockford_js_the_good_parts git:(master) ✗
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment