add this fancy recent changes module
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
David 2023-10-11 21:37:28 -04:00
parent a33c4ca92b
commit 18d7a3e7b1
4 changed files with 145 additions and 90 deletions

View File

@ -1,4 +1,4 @@
FROM node:20-slim AS builder
FROM node:20 AS builder
COPY . /src
WORKDIR /src

View File

@ -161,6 +161,16 @@ ul.nav li a:hover {
line-height: 22px;
text-align: justify;
}
#info details {
font-size: 15px;
padding: 4px;
line-height: 22px;
text-align: justify;
}
#info details summary {
text-decoration: underline;
cursor: pointer;
}
#Stores {
margin: 0 auto;

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<script
defer
defer=""
data-domain="nycbookstores.org"
src="https://stats.yetaga.in/js/script.hash.outbound-links.js"
></script>
@ -31,7 +31,7 @@
media="screen"
rel="stylesheet"
type="text/css"
href="/css/site.css?1678239113605"
href="/css/site.css?1697074571690"
/>
<meta
property="title"
@ -143,10 +143,21 @@
survives at this point).
</p>
<p>
There are currently <span id="storeCount">111</span> stores indexed
There are currently <span id="storeCount">114</span> stores indexed
on this page. Last updated
<span id="updatedOn">March 7, 2023</span>.
<span id="updatedOn">October 11, 2023</span>.
</p>
<details>
<summary>Recent Changes</summary>
<ul id="changesList">
<li>
October 8, 2023 - move Burnt Books into Hey Kids!, update
archestratus to note there's no cafe anymore
</li>
<li>September 30, 2023 - add Lofty Pigeon Books</li>
<li>September 19, 2023 - Move Yu and Me to Essex Market</li>
</ul>
</details>
</div>
<div id="selected"></div>
</div>
@ -159,7 +170,7 @@
<tbody>
<tr id="0" class="spotRow">
<td class="name">1804 Books</td>
<td>320 W 37th Street, New York</td>
<td>320 W 37th St, New York</td>
</tr>
<tr id="1" class="spotRow">
<td class="name">192 Books</td>
@ -167,7 +178,7 @@
</tr>
<tr id="2" class="spotRow">
<td class="name">Adanne</td>
<td>234 Water Street, Brooklyn</td>
<td>234 Water St, Brooklyn</td>
</tr>
<tr id="3" class="spotRow">
<td class="name">Aeon Bookstore</td>
@ -183,7 +194,7 @@
</tr>
<tr id="6" class="spotRow">
<td class="name">Archestratus</td>
<td>160 Huron St, Brooklyn</td>
<td>164 Huron St, Brooklyn</td>
</tr>
<tr id="7" class="spotRow">
<td class="name">Argosy Books</td>
@ -191,24 +202,24 @@
</tr>
<tr id="8" class="spotRow">
<td class="name">Astoria Bookshop</td>
<td>31-29 31st St, Astoria</td>
<td>36-19 30th St, Astoria</td>
</tr>
<tr id="9" class="spotRow">
<td class="name">Avoid The Day Bookstore &amp; Cafe</td>
<td>99-04 A Rockaway Beach Blvd, Rockaway Park</td>
</tr>
<tr id="10" class="spotRow">
<td class="name">Berl's Brooklyn Poetry Shop</td>
<td>126A Front St, Brooklyn</td>
</tr>
<tr id="11" class="spotRow">
<tr id="10" class="spotRow">
<td class="name">Better Read Than Dead</td>
<td>867 Broadway, Brooklyn</td>
</tr>
<tr id="12" class="spotRow">
<tr id="11" class="spotRow">
<td class="name">Better Read Than Dead &amp; Burly Coffee</td>
<td>90 Kosciuszko St, Brooklyn</td>
</tr>
<tr id="12" class="spotRow">
<td class="name">Black Spring Books</td>
<td>672 Driggs Ave, Brooklyn</td>
</tr>
<tr id="13" class="spotRow">
<td class="name">Bluestockings Cooperative</td>
<td>116 Suffolk Street, New York</td>
@ -275,7 +286,7 @@
</tr>
<tr id="29" class="spotRow">
<td class="name">Burnt Books</td>
<td>1014 Manhattan Ave, Brooklyn</td>
<td>157 Huron St, Brooklyn</td>
</tr>
<tr id="30" class="spotRow">
<td class="name">Cafe con Libros</td>
@ -283,7 +294,7 @@
</tr>
<tr id="31" class="spotRow">
<td class="name">Catland</td>
<td>987 Flushing Ave, Brooklyn</td>
<td>985 Flushing Ave, Brooklyn</td>
</tr>
<tr id="32" class="spotRow">
<td class="name">Chartwell Booksellers</td>
@ -307,7 +318,7 @@
</tr>
<tr id="37" class="spotRow">
<td class="name">Dear Friend Books</td>
<td>343A Tompkins Avenue, Brooklyn</td>
<td>343A Tompkins Ave, Brooklyn</td>
</tr>
<tr id="38" class="spotRow">
<td class="name">Desert Island Comics</td>
@ -330,62 +341,60 @@
<td>686 Fulton St, Brooklyn</td>
</tr>
<tr id="43" class="spotRow">
<td class="name">
Greenlight Bookstore (Prospect Lefferts Gardens)
</td>
<td>632 Flatbush Ave, Brooklyn</td>
</tr>
<tr id="44" class="spotRow">
<td class="name">Here's A Book Store</td>
<td>1964 Coney Island Ave, Brooklyn</td>
</tr>
<tr id="45" class="spotRow">
<tr id="44" class="spotRow">
<td class="name">Hey Kids! Comics</td>
<td>157 Huron St, Brooklyn</td>
</tr>
<tr id="46" class="spotRow">
<tr id="45" class="spotRow">
<td class="name">Housing Works Bookstore Café</td>
<td>126 Crosby St, New York</td>
</tr>
<tr id="47" class="spotRow">
<tr id="46" class="spotRow">
<td class="name">Human Relations Books</td>
<td>1067 Flushing Ave, Brooklyn</td>
</tr>
<tr id="48" class="spotRow">
<tr id="47" class="spotRow">
<td class="name">Idlewild Books</td>
<td>170 7th Avenue S, New York</td>
</tr>
<tr id="49" class="spotRow">
<tr id="48" class="spotRow">
<td class="name">James Cummins Bookseller</td>
<td>699 Madison Ave, 7th Floor, New York</td>
</tr>
<tr id="50" class="spotRow">
<tr id="49" class="spotRow">
<td class="name">Joanne Hendricks Cookbooks</td>
<td>488 Greenwich St, New York</td>
</tr>
<tr id="51" class="spotRow">
<tr id="50" class="spotRow">
<td class="name">Karma Bookstore</td>
<td>136 East Third St, New York</td>
</tr>
<tr id="52" class="spotRow">
<tr id="51" class="spotRow">
<td class="name">Kew &amp; Willow Books</td>
<td>81-63 Lefferts Boulevard, New York</td>
</tr>
<tr id="53" class="spotRow">
<tr id="52" class="spotRow">
<td class="name">Kinokunya</td>
<td>1073 Avenue of the Americas, New York</td>
</tr>
<tr id="54" class="spotRow">
<tr id="53" class="spotRow">
<td class="name">Kitchen Arts &amp; Letters</td>
<td>1435 Lexington Ave, New York</td>
</tr>
<tr id="55" class="spotRow">
<tr id="54" class="spotRow">
<td class="name">Leaves Bookstore</td>
<td>140 Nassau Ave, Brooklyn</td>
</tr>
<tr id="56" class="spotRow">
<tr id="55" class="spotRow">
<td class="name">Left Bank Books</td>
<td>41 Perry Street, New York</td>
<td>41 Perry St, New York</td>
</tr>
<tr id="56" class="spotRow">
<td class="name">Lofty Pigeon Books</td>
<td>743 Church Ave, Brooklyn</td>
</tr>
<tr id="57" class="spotRow">
<td class="name">Logos Bookstore</td>
@ -397,7 +406,7 @@
</tr>
<tr id="59" class="spotRow">
<td class="name">McNally Jackson Books</td>
<td>52 Prince St, New York</td>
<td>134 Prince St, New York</td>
</tr>
<tr id="60" class="spotRow">
<td class="name">McNally Jackson Books City Point</td>
@ -437,173 +446,185 @@
</tr>
<tr id="69" class="spotRow">
<td class="name">P&amp;T Knitwear</td>
<td>180 Orchard Street, New York</td>
<td>180 Orchard St, New York</td>
</tr>
<tr id="70" class="spotRow">
<td class="name">Passageway Books</td>
<td>150 9th Ave, New York</td>
</tr>
<tr id="71" class="spotRow">
<td class="name">Pillow-Cat Books</td>
<td>328 East 9th St, New York</td>
</tr>
<tr id="71" class="spotRow">
<tr id="72" class="spotRow">
<td class="name">Posman Books Chelsea Market</td>
<td>75 9th Avenue, New York</td>
</tr>
<tr id="72" class="spotRow">
<td class="name">POWERHOUSE @ IC</td>
<td>220 36th Street, Building #2, Brooklyn</td>
</tr>
<tr id="73" class="spotRow">
<td class="name">POWERHOUSE @ IC</td>
<td>220 36th St, Building #2, Brooklyn</td>
</tr>
<tr id="74" class="spotRow">
<td class="name">POWERHOUSE Arena</td>
<td>28 Adams St, Brooklyn</td>
</tr>
<tr id="74" class="spotRow">
<tr id="75" class="spotRow">
<td class="name">POWERHOUSE on 8th</td>
<td>1111 8th Ave, Brooklyn</td>
</tr>
<tr id="75" class="spotRow">
<tr id="76" class="spotRow">
<td class="name">Printed Matter</td>
<td>231 11th Ave, New York</td>
</tr>
<tr id="76" class="spotRow">
<tr id="77" class="spotRow">
<td class="name">Printed Matter St. Marks</td>
<td>38 St. Marks Pl, New York</td>
</tr>
<tr id="77" class="spotRow">
<tr id="78" class="spotRow">
<td class="name">Quest Bookshop</td>
<td>240 E 53rd St, New York</td>
</tr>
<tr id="78" class="spotRow">
<td class="name">Quimby's Bookstore</td>
<td>536 Metropolitan Avenue, Brooklyn</td>
</tr>
<tr id="79" class="spotRow">
<td class="name">Quimby's Bookstore</td>
<td>536 Metropolitan Ave, Brooklyn</td>
</tr>
<tr id="80" class="spotRow">
<td class="name">Recirculation</td>
<td>876 Riverside Dr, New York</td>
</tr>
<tr id="80" class="spotRow">
<tr id="81" class="spotRow">
<td class="name">Respect For Life Books-N-Things</td>
<td>537 Nostrand Ave, Brooklyn</td>
</tr>
<tr id="81" class="spotRow">
<tr id="82" class="spotRow">
<td class="name">Revolution Books</td>
<td>437 Malcolm X Blvd, New York</td>
</tr>
<tr id="82" class="spotRow">
<tr id="83" class="spotRow">
<td class="name">Rizzoli Bookstore</td>
<td>1133 Broadway, New York</td>
</tr>
<tr id="83" class="spotRow">
<tr id="84" class="spotRow">
<td class="name">Shakespeare &amp; Company</td>
<td>939 Lexington Ave, New York</td>
</tr>
<tr id="84" class="spotRow">
<tr id="85" class="spotRow">
<td class="name">
Shakespeare &amp; Company (Upper West Side)
</td>
<td>2020 Broadway, New York</td>
</tr>
<tr id="85" class="spotRow">
<tr id="86" class="spotRow">
<td class="name">Sister's Uptown Bookstore</td>
<td>1942 Amsterdam Ave, New York</td>
</tr>
<tr id="86" class="spotRow">
<tr id="87" class="spotRow">
<td class="name">Spoonbill &amp; Sugartown, Booksellers</td>
<td>218 Bedford Ave, Brooklyn</td>
</tr>
<tr id="87" class="spotRow">
<tr id="88" class="spotRow">
<td class="name">Standards Manual</td>
<td>212 Franklin Street, Brooklyn</td>
</tr>
<tr id="88" class="spotRow">
<tr id="89" class="spotRow">
<td class="name">Strand Bookstore</td>
<td>828 Broadway, New York</td>
</tr>
<tr id="89" class="spotRow">
<tr id="90" class="spotRow">
<td class="name">Sweet Pickle Books</td>
<td>47 Orchard St, New York</td>
</tr>
<tr id="90" class="spotRow">
<tr id="91" class="spotRow">
<td class="name">Taylor &amp; Co. Books</td>
<td>1021 Cortelyou Rd, Brooklyn</td>
</tr>
<tr id="92" class="spotRow">
<td class="name">Terrace Books</td>
<td>242 Prospect Park West, Brooklyn</td>
</tr>
<tr id="91" class="spotRow">
<tr id="93" class="spotRow">
<td class="name">The Austin Book Shop</td>
<td>104-29 Jamaica Ave, Richmond Hill</td>
</tr>
<tr id="92" class="spotRow">
<tr id="94" class="spotRow">
<td class="name">The Book Cellar</td>
<td>1465 York Ave, New York</td>
</tr>
<tr id="93" class="spotRow">
<tr id="95" class="spotRow">
<td class="name">The Center for Fiction</td>
<td>15 Lafayette Ave, Brooklyn</td>
</tr>
<tr id="94" class="spotRow">
<tr id="96" class="spotRow">
<td class="name">The Corner Bookstore</td>
<td>1313 Madison Ave, New York</td>
</tr>
<tr id="95" class="spotRow">
<tr id="97" class="spotRow">
<td class="name">The Drama Book Shop</td>
<td>266 W 39th St, New York</td>
</tr>
<tr id="96" class="spotRow">
<tr id="98" class="spotRow">
<td class="name">The Lit. Bar</td>
<td>131 Alexander Ave, Bronx</td>
</tr>
<tr id="97" class="spotRow">
<tr id="99" class="spotRow">
<td class="name">The Mysterious Bookshop</td>
<td>58 Warren St, New York</td>
</tr>
<tr id="98" class="spotRow">
<td class="name">The Strand At Columbus Ave</td>
<td>450 Columbus Avenue, New York</td>
</tr>
<tr id="99" class="spotRow">
<td class="name">The Word Is Change</td>
<td>368 Tompkins Avenue, Brooklyn</td>
</tr>
<tr id="100" class="spotRow">
<td class="name">The Ripped Bodice</td>
<td>218 5th Ave, Brooklyn</td>
</tr>
<tr id="101" class="spotRow">
<td class="name">The Strand At Columbus Ave</td>
<td>450 Columbus Ave, New York</td>
</tr>
<tr id="102" class="spotRow">
<td class="name">The Word Is Change</td>
<td>368 Tompkins Ave, Brooklyn</td>
</tr>
<tr id="103" class="spotRow">
<td class="name">Three Lives &amp; Company</td>
<td>238 West 10th St, New York</td>
</tr>
<tr id="101" class="spotRow">
<tr id="104" class="spotRow">
<td class="name">Topos Bookstore Cafe</td>
<td>788 Woodward Ave, Brooklyn</td>
</tr>
<tr id="102" class="spotRow">
<tr id="105" class="spotRow">
<td class="name">Troubled Sleep Books</td>
<td>129 6th Ave, Brooklyn</td>
</tr>
<tr id="103" class="spotRow">
<tr id="106" class="spotRow">
<td class="name">Turn The Page... Again</td>
<td>39-15a Bell Blvd, Flushing</td>
</tr>
<tr id="104" class="spotRow">
<tr id="107" class="spotRow">
<td class="name">Unnameable Books</td>
<td>600 Vanderbilt Ave, Brooklyn</td>
</tr>
<tr id="105" class="spotRow">
<tr id="108" class="spotRow">
<td class="name">Ursus Books</td>
<td>50 East 78th St, Suite 1C, New York</td>
</tr>
<tr id="106" class="spotRow">
<tr id="109" class="spotRow">
<td class="name">Westsider Rare &amp; Used Books</td>
<td>2246 Broadway, New York</td>
</tr>
<tr id="107" class="spotRow">
<tr id="110" class="spotRow">
<td class="name">Westsider Records</td>
<td>233 West 72nd St, New York</td>
</tr>
<tr id="108" class="spotRow">
<tr id="111" class="spotRow">
<td class="name">Word Bookstore</td>
<td>126 Franklin St, Brooklyn</td>
</tr>
<tr id="109" class="spotRow">
<tr id="112" class="spotRow">
<td class="name">Word Up Books</td>
<td>2113 Amsterdam Ave, New York</td>
</tr>
<tr id="110" class="spotRow">
<tr id="113" class="spotRow">
<td class="name">Yu and Me Books</td>
<td>44 Mulberry St, New York</td>
<td>115 Delancey St Stall #11, New York</td>
</tr>
</tbody>
</table>

View File

@ -1,7 +1,29 @@
import { load } from "cheerio";
import { readFile, writeFile } from "fs";
import process from "child_process";
import stores from "./stores.json" assert { type: "json" };
function GetRecentChanges() {
const res = process
.execSync('git log -4 --pretty=format:"%ct %s"')
.toString();
return res.split("\n");
}
function ChangeLog(logs) {
let res = "\n";
logs.forEach((l, i) => {
const s = l.split(" ");
const date = new Date(s[0] * 1000).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
});
res = res + `<li>${date} - ${s.slice(1).join(" ")}</li>\n`;
});
return res;
}
function TableViewTemplate(rows) {
let table = "<table>";
rows.forEach((row, key) => {
@ -20,6 +42,7 @@ function TableRowTemplate({ rowNumber, name, address, city }) {
}
readFile("./index.html", function (err, data) {
const changeList = GetRecentChanges();
if (err) {
throw err;
}
@ -40,6 +63,7 @@ readFile("./index.html", function (err, data) {
day: "numeric",
})
);
$("#changesList").html(ChangeLog(changeList));
const cssurl = $("link[type='text/css']").attr("href").split("?")[0];
$("link[type='text/css']").attr("href", cssurl + "?" + new Date().getTime());
writeFile("./index.html", $.html(), (err) => {