Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tjheffner committed Mar 28, 2024
1 parent 837a010 commit 8b5595b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/Currently.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
export let recentlyPlayed
export let duolingo
const formattedDate = new Date(duolingo.streakData.currentStreak.startDate).toLocaleDateString('en-us', { year:"numeric", month:"short", day:"numeric"})
const formattedDate = new Date(duolingo.streakData.currentStreak.startDate)
.toLocaleDateString('en-us', { year: 'numeric', month: 'short', day: 'numeric'})
// https://dev.to/jorik/country-code-to-flag-emoji-a21
function getFlagEmoji(countryCode) {
const codePoints = countryCode
.toUpperCase()
Expand Down
15 changes: 11 additions & 4 deletions src/routes/(main)/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { LASTFM_API_KEY, STEAM_API_KEY } from '$env/static/private'
import { LASTFM_ID, LETTERBOXD_ID, STEAM_ID, DUOLINGO_ID } from '$lib/siteConfig'
import {
LASTFM_ID,
LETTERBOXD_ID,
STEAM_ID,
DUOLINGO_ID,
} from '$lib/siteConfig'
import letterboxd from 'letterboxd'

/** @type {import('./$types').PageServerLoad} */
Expand Down Expand Up @@ -28,14 +33,16 @@ export async function load({ fetch, params }) {
const steam_json = await steam_res.json()
const recentlyPlayed = steam_json.response

// Fetch stats from Duolingo.
const duolingo_res = await fetch(`https://www.duolingo.com/2017-06-30/users?username=${DUOLINGO_ID}`)
// Fetch stats from Duolingo. This is an unofficial endpoint, may break!!
const duolingo_res = await fetch(
`https://www.duolingo.com/2017-06-30/users?username=${DUOLINGO_ID}`
)
const duolingo_json = await duolingo_res.json()

return {
recentlyListened,
recentlyWatched,
recentlyPlayed,
duolingo: duolingo_json.users[0]
duolingo: duolingo_json.users[0],
}
}
8 changes: 1 addition & 7 deletions src/routes/(main)/blog/fuzzySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ function _fuzzySearch(items, selectedCategories, search) {
})
if (search) {
const haystack = filteredItems.map((v) =>
[
v.title,
v.subtitle,
v.tags,
v.content,
v.description,
].join(' ')
[v.title, v.subtitle, v.tags, v.content, v.description].join(' ')
)
const idxs = u.filter(haystack, search)
const info = u.info(idxs, haystack, search)
Expand Down

0 comments on commit 8b5595b

Please sign in to comment.