-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
128 lines (116 loc) · 3.08 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head>
<title>FCC Go Image Search</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
h3 {
border-bottom: 1px solid #6991ad;
}
code {
display: block;
margin: 10px 0;
padding: 10px;
background-color: #cbeaff;
border: 1px solid #6991ad;
border-radius: 3px;
color: #345871;
overflow-x: scroll;
}
code a:hover {
color: #404a51;
}
pre {
margin: 0;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
li {
margin: 0 0 24px 0;
padding: 0;
}
.content {
max-width: 600px;
margin: 0 auto;
}
a {
color: #6991ad;
text-decoration: none;
transition: all .4s ease-in-out
}
a:hover {
color: #cbeaff;
text-decoration: none;
}
strong {
display: block;
}
</style>
</head>
<body>
<div class="content">
<h1>FCC Go Image Search Abstraction Layer</h1>
<p>
This is a image search abstraction layer written with
<a href="https://golang.org">Go</a> as a solution to Free Code
Camp's <a href="https://www.freecodecamp.org/challenges/image-search-abstraction-layer">Image Search Abstraction
API Project</a>
</p>
<p><a href="https://github.com/jcloutz/fcc-image-search">View Source</a></p>
<h2>Instructions</h2>
<ul>
<li>
<strong>Search for images</strong>
Parameters:
<ul>
<li>offset: <i>int</i> default 1, </li>
</ul>
<code>
<a href="{{ .Host }}/api/imagesearch/lolcats?offset=1">{{ .Host }}/api/imagesearch/lolcats?offset=1</a>
</code>
Expected output:
<code>
<pre>
[
{
url: "http://i0.kym-cdn.com/photos/images/original/001/284/242/202.jpg",
snippet: "LOLcats | Know Your Meme",
thumbnail: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRwJE7uvsmEKEj2i-GEWuOJ_pBy8OTx2guE3bFWFkINcl4tmMZ37OBPn7Hb",
context: "http://knowyourmeme.com/photos/1284242-lolcats"
}
]</pre>
</code>
</li>
<li>
<strong>View Recent Queries</strong>
<code>
<a href="{{ .Host }}/api/latest/imagesearch">{{ .Host }}/api/latest/imagesearch</a>
</code>
Will redirect to:
<code>
<pre>
[
{
term: "lolcats",
when: "2017-10-09T20:49:39.49-04:00"
},
{
term: "loldogs",
when: "2017-10-06T23:33:02.293-04:00"
}
]
</pre>
</code>
</li>
</ul>
</div>
</body>
</html>