Skip to content

Commit

Permalink
professionalize readme, add total count and rewrite some of the intro
Browse files Browse the repository at this point in the history
  • Loading branch information
kiawildberger committed Apr 8, 2021
1 parent ccdf54f commit 463b6ce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
i wanted to make a stupid meme edit of anthony fantano giving an ass review to an album but i had to go to like shopping.com or something to sort the reviews by most disliked and i thought it would be cool if there was a catalogue of fantano reviews that could be sorted by actual score instead of likes/dislikes/comments/views
so i made it myself~
## fantanosort


Youtube channel [theneedledrop](https://youtube.com/c/theneedledrop), run by Anthony Fantano (the internet's busiest music nerd), has reviewed hundreds of albums. It's the perfect channel to make a quick organization tool for.
Binary file added favicon.ico
Binary file not shown.
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<head>
<title>TheNeedleDrop Review Scores</title>
<title>fantanosort - theneedledrop reviews, sorted</title>
<link rel="favicon" href="./favicon.ico"/>
</head>
<body>
<div>
<div style="margin-top:4em;margin-left:4em;">
This is a list of all of Anthony Fantano's album reviews &mdash; though I'm sure I'm missing some &mdash; made easily searchable and sortable by score, upload date, and name. Dates and times are in UTC.<br><br>
If a score is off or something went wrong, head over to the <a href="https://github.com/kiawildberger/fantanosort">repo</a>, look in override.js, and submit a pull request, all the json data can be changed.
This is a list of the majority of Anthony Fantano's album reviews &mdash; though I'm sure I'm missing some &mdash; made easily searchable, and maybe sortable in the future? Dates and times are in UTC, and data is updated hourly.<br><br>
If a score is off or it looks like something went wrong, head over to the <a href="https://github.com/kiawildberger/fantanosort">repo</a> and look in override.js for instructions on how to edit the review details.
</div><br>
<input type="text" id="filter" placeholder="Filter"> <input type="button" value="Apply"><span id="countresults"></span>
<input type="text" id="filter" placeholder="Filter"> <input type="button" value="Apply" title="leave search blank for full list"><span id="countresults"></span>
<table id="table">
<tr>
<tr id="headers">
<th>Video</th>
<th>Album</th>
<th>Artist</th>
Expand Down
25 changes: 9 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,40 @@ function createTR(i) {
table.appendChild(tr)
}
function resetTR() {
Array.from(document.querySelectorAll("tr")).forEach(e => e.remove())
Array.from(document.querySelectorAll("tr")).forEach(e => {if(e.id != "headers")e.remove()})
}

async function populate() {
let data = await fetch("https://raw.githubusercontent.com/kiawildberger/fantanosort/master/result.json")
json = await data.json()
for(i in json) { // huge
i = json[i]
// if(i.artist === "Mogwai") return;
if(!i.artist||!i.album) return;
array.push({
artist:i.artist,
album:i.album,
rating:i.rating,
date:i.date,
nicedate:i.nicedate,
id:i.id,
thumb:i.thumb
})
array.push(i)
createTR(i)
}
}
populate()

// all this just so it shows the "** reviews loaded" smh
async function start() { await populate(); countresults.innerText=array.length+" reviews loaded" } start()

filter.addEventListener("keypress", e => { if(e.keyCode === 13) process() })
button.addEventListener("click", process)

function process() {
if(filter.value === "") array.forEach(e => createTR)
let total;
if(filter.value === "") total = array // yes i understand what this means
let artists = array.filter(x => x.artist.toLowerCase().includes(filter.value.toLowerCase()))
let albums = array.filter(x => x.album.toLowerCase().includes(filter.value.toLowerCase()))
resetTR()
let total = Array.from(artists.concat(albums))
if(!total) total = Array.from(artists.concat(albums))
if(total.length === 0) {
countresults.innerText = "nothing found for \""+filter.value+"\""
} else {
countresults.innerText = total.length +" results found for \""+filter.value+"\""
if(filter.value!="") countresults.innerText = total.length +" results found for \""+filter.value+"\""
total.forEach(e => {
createTR(e)
})
}

if(filter.value==="") countresults.innerText = array.length+" reviews loaded"
}

0 comments on commit 463b6ce

Please sign in to comment.