Update your Now page, automatically https://melanie.lol/now
  • JavaScript 100%
Find a file
Melanie Kat 8d2683673a
All checks were successful
update now / build (push) Successful in 16s
nit
2026-01-09 10:28:38 -08:00
.forgejo/workflows preview of hardcover support, needs documentation 2025-12-30 22:22:57 -08:00
.env.example preview of hardcover support, needs documentation 2025-12-30 22:22:57 -08:00
.gitignore init 2025-12-17 17:57:14 -08:00
biome.json dependency upgrades, html-entities pkg for decoding html entities, RSS image support, Atom support 2026-01-09 09:52:20 -08:00
config.js dependency upgrades, html-entities pkg for decoding html entities, RSS image support, Atom support 2026-01-09 09:52:20 -08:00
index.js remove dotenv 2026-01-07 12:30:45 -08:00
lefthook.yml init 2025-12-17 17:57:14 -08:00
package-lock.json dependency upgrades, html-entities pkg for decoding html entities, RSS image support, Atom support 2026-01-09 09:52:20 -08:00
package.json dependency upgrades, html-entities pkg for decoding html entities, RSS image support, Atom support 2026-01-09 09:52:20 -08:00
README.md nit 2026-01-09 10:28:38 -08:00
utils.js fontAwesomeListRegex - no longer needs to have links 2026-01-09 10:20:00 -08:00

now-updater

Update your Now page, automatically

Demo

How It Works

You define a connection and a URL in the config.js file so that it looks for a Markdown link with the URL and replaces the text with the connection's value.

For example, with markdownLinkRegex('melkat.blog'):

- {blog} [tktk](https://melkat.blog)

Becomes:

- {blog} [My Latest Post](https://melkat.blog)

And with fontAwesomeListRegex('heart'):

- {heart} tktk

Becomes:

- {heart} Hatsune Miku

To keep this going automatically, we use a Forgejo Action runner configured to run every three hours.

While it does run every three hours, it only updates your now page when there has been a change.

Getting Started

  1. Fork this repo, and go to theTRAKT_SLURM Settings tab, select Actions and go to Variables
  2. Create a variable OMGLOL_USERNAME and set it to your omg.lol username. So for me, it's melanie
  • This is where you store nonsensitive variables. Currently this is only used for your omg.lol username.
  1. Also in Settings under Actions, select Secrets
  2. Create a secret OMGLOL_KEY and set it to your omg.lol API key
  • This is where you will define any sensitive keys, for example the optional keys:
    • HARDCOVER_AUTH_HEADER
    • TRAKT_SLURM
    • STEAM_WEBAPI_KEY
  1. Once you are ready, you can enable the Forgejo Action by going to the fork's settings page. From the sidebar, go to Units and then Overview. This will take you to a page where you can enable actions.
  • Check the box next to Actions and don't forget to click save.

If you're running this locally, you may also want to copy the .env.example to .env and store those values there too. The .env file is git ignored for a reason, so be sure not to commit it.

Configuring

Configuring is all done within the config.js in the items array.

For example, to get the latest post from my blog's JSON feed.

{
  id: 'blog',
  regex: markdownLinkRegex('melkat.blog'),
  getLatest: async () =>
    getJsonFeedItemTitle('https://melkat.blog/feed.json'),
},
  • id: Used for logs
  • regex: The regex used for finding the what to replace
    • markdownLinkRegex(url): Replaces the text of a link with the result of getLatest (don't include the https:// part of the url)
    • fontAwesomeListRegex(icon): Replaces the text after a Font Awesome icon (example: heart) with the result returned in getLatest
  • getLatest: an async function to fetch the data and return a string used to be the new text

Available Functions

Basics

  • getAtomItemTitle(ATOM_URL, showImage = true): For getting the title of a Atom feed entry and when available the entry's image (unless the last argument is false)
  • getRSSItemTitle(RSS_URL, showImage = true): For getting the title of a RSS feed item and when available the item's image (unless the last argument is false)
  • getJsonFeedItemContent(feedUrl, showImage = true): For getting the content_html of a JSON feed item and when available the item's image (unless the last argument is false)
  • getJsonFeedItemTitle(feedUrl, showImage = true): For getting the title of a JSON feed item and when available the item's image (unless the last argument is false)

Service Specific

  • getBooklogrReading(booklogrUrl, booklogrUsername): For getting the books that are marked currently reading from a Booklogr instance
  • getHardcoverReading(showImage = true): For getting the book you are reading, with a cover of the image (unless the last argument is false)
    • Requires the environment variable HARDCOVER_AUTH_HEADER to be set. You can find that in your account setting's API access page
  • getLetterboxdActivity(letterboxdUsername, showImage = true): For getting the latest item from your Letterboxd RSS feed and the image from the description (unless the last argument is false)
  • getMalojaScrobble(malojaUrl): For getting the latest scrobble artist and track title
  • getTraktEpisode(traktUsername, traktId, showImage = true): For getting the latest watched TV episode's show name, season and episode number, episode title, and episode image (unless the last argument is false)
    • Requires the environment variable TRAKT_SLURM to be set. You can get it from your dashboard by clicking the RSS icon and getting the SLURM from the RSS Feed's query parameter
  • getSteamRecentlyPlayed(steamAccountId): For getting the most recently played game from your Steam profile.
    • Requires the environment variable STEAM_WEBAPI_KEY to be set. Get the API key here and your Steam Account ID here
    • Note: Steam's most recent game is actually the most played game in the last two weeks, not your actual most recently played game.

Support

Got a question? Reach out to me on Mastodon, @zicklepop@nyan.lol and I will do my best.

Did you find this useful? Donate to Trans Lifeline or The Trevor Project.