-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjobs.html
65 lines (56 loc) · 2.02 KB
/
jobs.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
---
title: 徵才職缺
---
<div>
<h3 class="text-center">
<a href="https://github.com/f2etw/jobs/issues">如果你也想要徵才/求職,歡迎張貼!</a>
</h3>
<hr>
<noscript>
<div>
<h3>您的瀏覽器可能不支援「顯示職缺」的功能</h3>
<p style="font-size:1em;">
請使用最新版的 Firefox 或是 Chrome 以便獲得最佳體驗。
或者,您可以點擊上方標題前往 GitHub 查看當前職缺。
</p>
</div>
</noscript>
<ul class="jobs js-jobs posts">
<a class="job__link" href="https://facebook.com/10153285570810982"></a>
<time class="job__createtime"></time>
<ul class="job__tags ul-reset">
<li class="job__tags__item"></li>
</ul>
</li>
</ul>
</div>
<script>
fetch('https://api.github.com/repos/f2etw/jobs/issues').then(function(response) {
return response.json();
})
.then(function (jobs) {
var content = '';
jobs.forEach(function(job, index, array) {
if (job.pull_request !== undefined){return;}
content += `
<li class="job">
<a class="job__link" href="${job.html_url}">${job.title}</a>
<time class="job__createtime">${job.created_at}</time>
<ul class="job__tags ul-reset">
${job.labels.map(
function(label){
return `<li class="job__tags__item" style="background:linear-gradient(#${label.color}, #${label.color});"><span>${label.name}</span></li>`
}).join("\n")}
</ul>
</li>
`;
});
return content;
})
.catch(function (content) {
return "<p>請點選上方連結以觀看徵才訊息!</p>";
})
.then(function (content) {
document.querySelector('.js-jobs').innerHTML += content;
});
</script>