Skip to content

Instantly share code, notes, and snippets.

View tclain's full-sized avatar

Timothée Clain tclain

View GitHub Profile
function myTemplate() {}
@tclain
tclain / algolia fetch.js
Last active May 8, 2019 14:12
algolia fetch
const ALGOLIA_PLACES = "https://places-dsn.algolia.net/1/places/query"
//const searchBody = (query) => `{"params":"hitsPerPage=5&language=en&query=${query}"}`
const searchBody = (query) => {
return JSON.stringify({
"params":`hitsPerPage=5&language=en&query=${query}`
})
}
/*
<li>
The name of my movie
<img href="" />
</li>*/
const omdbUrl = (query) => `http://www.omdbapi.com/?s=${query}&apikey=adf1f2d7`
/*
<li>
The name of my movie
<img href="" />
</li>*/
const omdbUrl = (query) => `http://www.omdbapi.com/?s=${query}&apikey=adf1f2d7`
const authorization = "Bearer sk_c25cc80d2eb82759b32f9bd53204af89";
// TODO
const fetchData = (email) => {
fetch(`https://person.clearbit.com/v2/combined/find?email=${email}`, {
headers: new Headers({
Authorization: authorization
})
})
const garageName = 'montreal247'
const displayCar = (car) => {
const carList = document.querySelector('.cars-list')
carList.insertAdjacentHTML('beforeend', `
<div class="car">
<div class="car-image">
<img src="http://loremflickr.com/280/280/Ferrari 308 GTS" />
</div>
myTemplate`Hello !`
const externValue = "Timothee"
myTemplate`Hello ! ${externValue}`
myTemplate`Hello,${"Timothee"},World`
["Hello,", ",World"]