Created
August 16, 2015 17:56
-
-
Save kkarimi/22bccd0e8b1c1891f59f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<p>A2Dominion<br> | |
113 Uxbridge Road<br> | |
London, W5 5TL<br> | |
0800 432 0077<br> | |
<a href="http://www.a2dominion.co.uk/">http://www.a2dominion.co.uk/</a> | |
</p> | |
<p>The Abbeyfield (Chelsea & Fulham) Society Ltd<br> | |
9 Coniger Road,<br> | |
Fulham, London, SW6 3TB<br> | |
020 7352 8632<br> | |
<a href="http://www.abbeyfield.com">www.abbeyfield.com</a> | |
</p> | |
<p>Arhag Housing Ltd<br> | |
UnitB, Ground Floor,<br> | |
Mary Brancker House,<br> | |
54-74 Holmes Road,<br> | |
Kentish Town, London, NW5 3AQ<br> | |
020 7424 7370<br> | |
<a href="http://www.arhag.co.uk/">http://www.arhag.co.uk/</a> | |
</p> | |
<p>LHA-ASRA<br> | |
Greater London Housing Association Ltd<br> | |
Asra House,<br> | |
1 Long Lane,<br> | |
London, SE1 4PG<br> | |
020 7940 6600<br> | |
<a href="http://www.asra.org.uk/">www.asra.org.uk/</a> | |
</p> | |
<p>Catalyst Housing Group<br> | |
Ealing Gateway,<br> | |
26-30 Uxbridge Road,<br> | |
Ealing, London, lW5 2AU<br> | |
020 8832 3334<br> | |
<a href="http://www.chg.org.uk/">http://www.chg.org.uk/</a> | |
</p> | |
<p>Central & Cecil Housing trust<br> | |
( includes Cara Irish Housing Association)<br> | |
Cara House,<br> | |
341a Seven Sisters Road,<br> | |
London, N15 6RD<br> | |
020 8800 2744<br> | |
<a href="http://www.ccht.org.uk/">http://www.ccht.org.uk/</a> | |
</p> | |
<p>Circle Anglia<br> | |
1-3 Highbury Station Road<br> | |
London, N5 1JG<br> | |
020 7288 4000<br> | |
<a href="http://www.circleanglia.org/">http://www.circleanglia.org/</a> | |
</p> | |
<p>Ducane Housing Association Ltd<br> | |
11 Du Cane House,<br> | |
101 Du Cane Road ,<br> | |
London, W12 0UR<br> | |
020 8735 4990<br> | |
<a href="http://www.ducaneha.org.uk/">http://www.ducaneha.org.uk/</a> | |
</p> | |
<p>Ebony Sistren Housing Association<br> | |
Ravenscourt House,<br> | |
123 Askew Road,<br> | |
London, W12 9AU<br> | |
020 8740 0220</p> | |
<p>English Churches Housing Group<br> | |
2 Estuary Boulevard,<br> | |
Estuary Commerce Park,<br> | |
Liverpool, L24 8RF<br> | |
0845 155 9002<br> | |
<a href="http://www.riverside.org.uk/">http://www.riverside.org.uk/</a> | |
</p> | |
<p>Family Mosaic Housing Association<br> | |
Albion House<br> | |
20 Queen Elizabeth Street<br> | |
London, SE1 2RJ<br> | |
020 7089 1000<br> | |
<a href="http://www.familymosaic.co.uk/">http://www.familymosaic.co.uk/</a> | |
</p> | |
<p>Genesis Housing Group ( includes PCHA)<br> | |
Capital House<br> | |
25 Chapel Street<br> | |
London, NW1 5DT <br> | |
033 3000 3000 <br> | |
<a href="http://www.genesisha.org.uk">www.genesisha.org.uk</a> | |
</p> | |
<p>The Guinness Trust<br> | |
Robins House<br> | |
134-138 The Grove<br> | |
Stratford, London, E15 1NS<br> | |
020 3288 1900<br> | |
<a href="http://www.guinnesspartnership.com/">http://www.guinnesspartnership.com/</a> | |
</p> | |
<p>Habinteg Housing Association<br> | |
Holyer House,<br> | |
20-21 Red Lion Court,<br> | |
London, EC4A 3EB<br> | |
020 7822 8700<br> | |
<a href="http://www.habinteg.org.uk/">http://www.habinteg.org.uk/</a> | |
</p> | |
<p>Harrison Homes<br> | |
46 St James's Gardens,<br> | |
London, W11 4RQ.<br> | |
020 7603 4332<br> | |
<a href="http://www.harrisonhousing.org.uk">www.harrisonhousing.org.uk</a> | |
</p> | |
<p>Hammersmith United Charities<br> | |
Gloucester House,<br> | |
Sycamore Gardens,<br> | |
London. W6 OAS<br> | |
0208 740 6700<br> | |
<a href="http://www.hamunitedcharities.org.uk/">http://www.hamunitedcharities.org.uk/</a> | |
</p> | |
<p>Innisfree Housing Association<br> | |
190 Iverson Road,<br> | |
London, NW6 2HL<br> | |
020 7625 1818<br> | |
<a href="http://www.innisfree.org.uk/">http://www.innisfree.org.uk/</a> | |
</p> | |
<p>L&Q Housing Group<br> | |
Osborn House,<br> | |
Osborn Terrace,<br> | |
London, SE3 9DR<br> | |
0844 406 9000<br> | |
<a href="http://www.lqgroup.org.uk/">http://www.lqgroup.org.uk/</a> | |
</p> | |
<p>Lien Viet Housing Association Ltd<br> | |
100 Morning Lane,<br> | |
Hackney, London, E9 6LH<br> | |
0208 986 6123<br> | |
<a href="http://www.lienviet.org.uk/">http://www.lienviet.org.uk/</a> | |
</p> | |
<p>Look Ahead Housing and Care<br> | |
1 Derry Street,<br> | |
London, W8 5HY<br> | |
0207 937 1166<br> | |
<a href="http://www.lookahead.org.uk/">http://www.lookahead.org.uk/</a> | |
</p> | |
<p>The Lygon Almshouses<br> | |
313-321 Fulham Palace Road,<br> | |
London, SW6 6TH<br> | |
0207 731 6311</p> | |
<p>Notting Hill Housing Trust<br> | |
1 Sussex Place<br> | |
Hammersmith<br> | |
London W6 9EA<br> | |
0208 357 5000<br> | |
<a href="http://www.nottinghillhousing.org.uk/">http://www.nottinghillhousing.org.uk/</a> | |
</p> | |
<p>Octavia Housing<br> | |
Emily House,<br> | |
202-208 Kensal Road,<br> | |
London, W10 5BN<br> | |
020 8354 5515<br> | |
<a href="http://www.octaviahousing.org.uk/">http://www.octaviahousing.org.uk/</a> | |
</p> | |
<p>Orbit Housing Association<br> | |
Garden Court<br> | |
Harry Weston Road<br> | |
Binley Business Park<br> | |
Coventry, CV3 2SU<br> | |
02476 438 000<br> | |
<a href="http://www.orbit.org.uk/">http://www.orbit.org.uk/</a> | |
</p> | |
<p>Origin Housing<br> | |
St Richards House,<br> | |
110 Eversholt Street,<br> | |
London, NW1 1BS<br> | |
020 7209 9222<br> | |
<a href="http://www.originhousing.org.uk/">http://www.originhousing.org.uk/</a> | |
</p> | |
<p>Peabody Trust<br> | |
45 Westminster Bridge Road,<br> | |
London, SE1 7JB<br> | |
020 7021 4444<br> | |
<a href="http://www.peabody.org.uk/">http://www.peabody.org.uk/</a> | |
</p> | |
<p>Pocklington Trust<br> | |
Pier House<br> | |
90 Strand on the Green<br> | |
London W4 3NN<br> | |
020 8995 0880<br> | |
<a href="http://www.pocklington-trust.org.uk/">http://www.pocklington-trust.org.uk/</a> | |
</p> | |
<p>Salvation Army Housing Association<br> | |
33-35 Chorley New Road<br> | |
Bolton, BL1 4QR<br> | |
0800 970 6363<br> | |
<a href="http://www.saha.org.uk/">http://www.saha.org.uk/</a> | |
</p> | |
<p>Shepherds Bush Housing Association<br> | |
Mulliner House<br> | |
Flanders Road ,<br> | |
Chiswick, London, W4 1NN<br> | |
0208 996 4200<br> | |
<a href="http://www.sbhg.co.uk/">http://www.sbhg.co.uk/</a> | |
</p> | |
<p>Sir Oswald Stoll Foundation<br> | |
446 Fulham Road,<br> | |
London. SW6 1DT<br> | |
0207 385 2110<br> | |
<a href="http://www.oswaldstoll.org.uk/">http://www.oswaldstoll.org.uk/</a> | |
</p> | |
<p>Southern Housing Group Ltd<br> | |
PO Box 643<br> | |
Horsham<br> | |
RH12 1XJ<br> | |
0300 303 1061 <br> | |
<a href="http://www.shgroup.org.uk">www.shgroup.org.uk</a> | |
</p> | |
<p>St Christophers Fellowship<br> | |
1 Putney High Street,<br> | |
London, SW15 1SZ<br> | |
020 8780 7800<br> | |
<a href="http://www.stchris.org.uk">www.stchris.org.uk</a> | |
</p> | |
<p>St Mungo's<br> | |
Griffin House,<br> | |
161 Hammersmith Road,<br> | |
London, W6 8BS<br> | |
020 8762 5500<br> | |
<a href="http://www.mungos.org/">http://www.mungos.org/</a> | |
</p> | |
<p>Sir William Powell's Almshouses<br> | |
c/o Sir Oswald Stoll Foundation,<br> | |
446 Fulham Road,<br> | |
London, SW6 1DT<br> | |
020 7385 2110<br> | |
<a href="http://www.oswaldstoll.org.uk/">http://www.oswaldstoll.org.uk/</a> | |
</p> | |
<p>Stadium Housing Association<br> | |
Olympic Office Centre<br> | |
Fulton Road, Wembley,<br> | |
Middlesex, HA9 0NU<br> | |
0300 373 3000<br> | |
<a href="http://www.stadiumha.org.uk/">http://www.stadiumha.org.uk/</a> | |
</p> | |
<p>Thames Valley Housing Association<br> | |
Premier House,<br> | |
52 London Road,<br> | |
Twickenham,<br> | |
Middlesex, TW1 3RP<br> | |
0208 607 0607<br> | |
<a href="http://www.tvha.co.uk/">http://www.tvha.co.uk/</a> | |
</p> | |
<p>Viridian<br> | |
Colwell House House<br> | |
376 Clapham Road<br> | |
London, SW9 9AR<br> | |
0330 123 0220<br> | |
<a href="http://www.viridianhousing.org.uk/">http://www.viridianhousing.org.uk/</a> | |
</p> | |
<p>Wandle Housing Association<br> | |
2nd Floor, Minerva House<br> | |
Montague Close<br> | |
London<br> | |
SE1 9BB<br> | |
0800 731 2030<br> | |
<a href="http://www.wandle.com/">http://www.wandle.com/</a> | |
</p> | |
<p>W14 Housing Co-Operative<br> | |
8 Waldergrave Road<br> | |
Teddington<br> | |
TW11 8GT<br> | |
020 8568 4112<br> | |
<a href="http://www.coophomes.coop">http://www.coophomes.coop</a> | |
</p> | |
<p>Westway Housing Association Ltd<br> | |
Unit B<br> | |
292 Kensal Road<br> | |
London, W10 5BE<br> | |
020 8964 2323<br> | |
<a href="http://www.westwayha.org.uk/">http://www.westwayha.org.uk/</a> | |
</p> | |
<p>Women’s Pioneer Housing Ltd<br> | |
227 Wood Lane,<br> | |
London, W12 0EX<br> | |
020 8749 7112<br> | |
<a href="http://www.womenspioneer.co.uk/">http://www.womenspioneer.co.uk/</a> | |
</p> | |
<p>Yarrow Housing<br> | |
216 Goldhawk Road,<br> | |
London, W12 9NX<br> | |
020 8735 4600<br> | |
<a href="http://www.yarrowhousing.org.uk">www.yarrowhousing.org.uk</a> | |
</p> | |
</div> | |
<script> | |
$(document).ready(function(){ | |
function exportToCsv(filename, rows) { | |
var processRow = function (row) { | |
var finalVal = ''; | |
for (var j = 0; j < row.length; j++) { | |
var innerValue = row[j] === null ? '' : row[j].toString(); | |
if (row[j] instanceof Date) { | |
innerValue = row[j].toLocaleString(); | |
}; | |
var result = innerValue.replace(/"/g, '""'); | |
if (result.search(/("|,|\n)/g) >= 0) | |
result = '"' + result + '"'; | |
if (j > 0) | |
finalVal += ','; | |
finalVal += result; | |
} | |
return finalVal + '\n'; | |
}; | |
var csvFile = ''; | |
for (var i = 0; i < rows.length; i++) { | |
csvFile += processRow(rows[i]); | |
} | |
var blob = new Blob([csvFile], { type: 'text/csv;charset=utf-8;' }); | |
if (navigator.msSaveBlob) { // IE 10+ | |
navigator.msSaveBlob(blob, filename); | |
} else { | |
var link = document.createElement("a"); | |
if (link.download !== undefined) { // feature detection | |
// Browsers that support HTML5 download attribute | |
var url = URL.createObjectURL(blob); | |
link.setAttribute("href", url); | |
link.setAttribute("download", filename); | |
link.style.visibility = 'hidden'; | |
document.body.appendChild(link); | |
link.click(); | |
document.body.removeChild(link); | |
} | |
} | |
} | |
var a = $("p"); | |
var structureData = function(data) { | |
var housingAssociationsTable = []; | |
var housingAssociations = []; | |
console.log(data.length); | |
for (var br = 0; br < data.length; br++) { | |
var ha = $(data[br]).text().split("\n"); | |
housingAssociations.push(ha); | |
var haData = { | |
name: ha[0] ? ha[0].replace(/\s/g, '') : '', | |
address: ha[1] ? ha[1].replace(/\s/g, '') : '', | |
address2: ha[2] ? ha[2].replace(/\s/g, '') : '', | |
phone: ha[3] ? ha[3].replace(/\s/g, '') : '', | |
website: ha[4] ? ha[4].replace(/\s/g, '') : '' | |
}; | |
housingAssociationsTable.push(haData); | |
} | |
console.table(housingAssociations); | |
return housingAssociations | |
}; | |
var b = structureData(a); | |
exportToCsv('has.csv', b); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment