Testing Imports with Emoji

This commit is contained in:
JP Hastings-Spital 2024-05-10 10:36:58 +01:00
parent baa43bdb40
commit 3ceda835ad
4 changed files with 40 additions and 11 deletions

View file

@ -0,0 +1,34 @@
---
title: This is your Internet on Capitalism
date: "2024-05-10T09:07:01Z"
emoji: "\U0001F62D"
publishDate: "2024-03-14T22:59:20Z"
bookmarkOf: https://www.takahe.org.nz/heat-death-of-the-internet/
references:
bookmark:
url: https://www.takahe.org.nz/heat-death-of-the-internet/
type: entry
name: Heat Death of the Internet
summary: You want to order from a local restaurant, but you need to download a
third-party delivery app, even though you plan to pick it up yourself. The prices
and menu on the app are different to what you saw in the window. When you download
a second app the prices are different again. You ring
author: estretton
tags:
- web
- internet
- capitalism
- advertising
---
Im painfully aware that Im now beyond the 35 year old cutoff that Douglas Adams pointed out[^1] makes me see new things as “against the natural order of things”, but I cant help but connect with this article that so heartbreakingly accurately depicts the experience of using the internet today (compared to my first experiences in the 90s).
I think, in a very real way, those chances are a normal part of something fuelled initially by passionate people becoming mainstream; but also its clear that the internet continues to be strip-mined as a potential source of business growth, and squeezed for every possible advertising penny.
I like my little corner of the web, untouched by [slop](/bookmarks/slop-is-the-new-name-for-unwanted-ai-generated-content) or ads; but I wish this was something my non-tech friends could engage with, in the way that everyone with something they wanted to say had a geocities account back in the late 90s — techie or not!
[^1]: > I've come up with a set of rules that describe our reactions to technologies:
> 1. Anything that is in the world when youre born is normal and ordinary and is just a natural part of the way the world works.
> 2. Anything that's invented between when youre fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it.
> 3. Anything invented after you're thirty-five is against the natural order of things.
>
> — Douglas Adams, The Salmon of Doubt

View file

@ -85,7 +85,9 @@ func isDir(pathStr string) bool {
var hashtags = regexp.MustCompile(`#\w+`)
func outputArticle(article Article, outputDir string) error {
slug := kebab(article.Title)
artEmoji, artTitle := shared.ExtractLeadingEmoji(article.Title)
slug := kebab(artTitle)
articlePath := path.Join(outputDir, fmt.Sprintf("%s.md", slug))
fm, _ := loadFrontmatter(articlePath)
@ -102,14 +104,9 @@ func outputArticle(article Article, outputDir string) error {
article.Annotation = strings.TrimSpace(article.Annotation)
if len(fm.Title) == 0 {
if strings.HasPrefix(article.Annotation, "# ") {
parts := strings.SplitAfterN(article.Annotation, "\n", 2)
article.Annotation = strings.TrimSpace(parts[1])
fm.Emoji, fm.Title = shared.ExtractLeadingEmoji(parts[0][2:])
} else {
fm.Title = article.Title
}
fm.Emoji, fm.Title = artEmoji, artTitle
}
fm.BookmarkOf = article.OriginalURL
fm.Tags = removeDupes(append(fm.Tags, article.Tags...))

View file

@ -207,7 +207,7 @@ func retrieveMentions(c Config) (Mentions, error) {
if res.StatusCode != http.StatusOK {
body, _ := io.ReadAll(res.Body)
return Mentions{}, fmt.Errorf("Non 200 response code: %v\n%s", res.StatusCode, body)
return Mentions{}, fmt.Errorf("non 200 response code: %v\n%s", res.StatusCode, body)
}
var m Mentions

View file

@ -3,7 +3,6 @@ package shared
import (
"bufio"
"embed"
"fmt"
"math/big"
"strings"
)
@ -69,7 +68,6 @@ func ExtractLeadingEmoji(str string) (string, string) {
for _, c := range parts[0] {
if _, ok := emojiCodePoints[c]; !ok {
fmt.Printf("%c: %d\n", c, c)
return "", str
}
}