-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFacebook Pages for Educators.html
70 lines (67 loc) · 2.07 KB
/
Facebook Pages for Educators.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/okegif/1/edit
-->
<head>
<meta charset=utf-8 />
<title>Facebook Pages for Educators</title>
<style>
h1 {
text-align: center;
color: red;
background-color: lightyellow;
}
</style>
</head>
<body>
<h1>Facebook Pages for Educators</h1>
<p>from <a href="https://www.facebook.com/safety/attachment/Facebook%20for%20Educators.pdf">
Facebook for Educators Guide</a></p>
<script>
var links = [
"National Geographic Education http://www.facebook.com/natgeoeducation",
"British Museum http://www.facebook.com/britishmuseum",
"Girl Up (UN Foundation) http://www.facebook.com/girlup",
"NASA http://www.facebook.com/NASA",
"Smithsonian Institution http://www.facebook.com/SmithsonianInstitution",
"Youth Olympic Games http://www.facebook.com/youtholympicgames",
"Library of Congress http://www.facebook.com/libraryofcongress",
"Musee du Louvre http://www.facebook.com/museedulouvre",
"PBS Kids http://www.facebook.com/PBSKIDS",
"Kabul Museum http://www.facebook.com/pages/Kabul-Museum/317714056516",
"Discovery Channel Global Education http://www.facebook.com/DCGEP",
"Scholastic Teachers http://www.facebook.com/ScholasticTeachers",
"Facebook in Education http://www.facebook.com/education",
"Get Schooled Foundation http://www.facebook.com/GetSchooledFoundation",
"Encyclopaedia Britannica http://www.facebook.com/BRITANNICA",
"Facebook for Educators http://www.facebook.com/fb4educators"];
function map(array, fn){
for(var i in array){ fn(array[i]); }
}
function reduce(array, value, fn){
map(array, function(item){ fn(item, value); });
return value;
}
var li = document.body.appendChild(
reduce(
links,
document.createElement('ol'),
function(str, val){
var arr = str.split(' ');
var a = val.appendChild(
document.createElement('li')
).appendChild(
document.createElement('a')
);
a.setAttribute( 'href', arr.pop() );
a.appendChild(
document.createTextNode(arr.join(' '))
);
}
)
);
</script>
</body>
</html>