Update your Now page, automatically https://melanie.lol/now
Find a file
Melanie Kat 1d49626439
All checks were successful
update now / build (push) Successful in 16s
graceful error handling, does not update services that did not return data
2025-12-18 11:27:30 -08:00
.forgejo/workflows trakt support 2025-12-17 21:53:32 -08:00
.env.example trakt support 2025-12-17 21:53:32 -08:00
.gitignore init 2025-12-17 17:57:14 -08:00
biome.json trakt support 2025-12-17 21:53:32 -08:00
config.js add rss support, linkding and gitea feeds 2025-12-17 22:21:52 -08:00
index.js graceful error handling, does not update services that did not return data 2025-12-18 11:27:30 -08:00
lefthook.yml init 2025-12-17 17:57:14 -08:00
package-lock.json letterboxd support 2025-12-17 21:35:31 -08:00
package.json letterboxd support 2025-12-17 21:35:31 -08:00
README.md documentation 2025-12-18 08:28:31 -08:00
utils.js add rss support, linkding and gitea feeds 2025-12-17 22:21:52 -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:

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

Becomes:

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

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 I use TRAKT_SLURM to store my SLURM key.

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 markdown link to replace the link text of
  • getLatest: an async function to fetch the data and return a string used to be the new link text

Available Functions

Basics

  • getJsonFeedItemContent(JSONFEED_URL): For getting the content_html of a JSON feed item and when available the item's image
  • getJsonFeedItemTitle(JSONFEED_URL): For getting the title of a JSON feed item and when available the item's image
  • getRSSItemTitle(RSS_URL): For getting the title of a RSS feed item

Service Specific

  • getLetterboxdActivity(LETTERBOXD_USERNAME): For getting the latest item from your Letterboxd RSS feed and the image from the description
  • getMalojaScrobble(MALOJA_URL): For getting the latest scrobble artist and track title
  • getTraktEpisode(TRAKT_USERNAME, TRAKT_ID): For getting the latest watched TV episode's show name, season and episode number, episode title, and episode image

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.