2025-12-18 01:57:14 +00:00
# now-updater
2025-12-25 23:19:35 +00:00
Automatically updates your omg.lol Now page with your latest activity.
2025-12-18 01:57:14 +00:00
2025-12-25 23:19:35 +00:00
> Fork of [melanie/now-updater](https://source.tube/melanie/now-updater) with added support for HTML output links, Mastodon, Last.fm, and dynamic URLs.
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
Demo: [dylan.omg.lol/now ](https://dylan.omg.lol/now )
2025-12-18 01:57:14 +00:00
## How It Works
2025-12-25 23:19:35 +00:00
Fetches content from RSS feeds, JSON feeds, and different services (Letterboxd, Trakt, Mastodon, Last.fm) and updates HTML or markdown links on your Now page. Runs every 3 hours via Forgejo Actions, only updating your page when changes are detected.
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
### Example
Your Now page links will be automatically updated from this:
**HTML links** (before):
```html
2025-12-28 17:23:27 +00:00
< a href = "service-link" > blog< / a >
< a href = "service-link" > gitlab< / a >
2025-12-25 23:19:35 +00:00
```
**Markdown links** (before):
2025-12-18 16:28:31 +00:00
```markdown
2025-12-28 17:23:27 +00:00
[blog ](service-link )
[gitlab ](service-link )
2025-12-18 16:28:31 +00:00
```
2025-12-25 23:19:35 +00:00
to this:
**HTML links** (after):
```html
< a href = "https://your-blog.com/2025/12/my-latest-post" > My Latest Post< / a >
2025-12-28 17:23:27 +00:00
< a href = "https://gitlab.com/username/project" > Pushed to repository< / a >
2025-12-25 23:19:35 +00:00
```
**Markdown links** (after):
2025-12-18 16:28:31 +00:00
```markdown
2025-12-25 23:19:35 +00:00
[My Latest Post ](https://your-blog.com/2025/12/my-latest-post )
2025-12-28 17:23:27 +00:00
[Pushed to repository ](https://gitlab.com/username/project )
2025-12-18 16:28:31 +00:00
```
2025-12-28 17:23:27 +00:00
**New in this fork**: Use service names as link text instead of URLs! Just write `<a href="service-link">servicename</a>` and the script fills in both the text and URL.
2025-12-25 23:19:35 +00:00
## Setup
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
1. Fork this repo
2. Enable Actions in repo settings
3. Add Actions variables: `OMGLOL_USERNAME` (your omg.lol username)
4. Add Actions secrets: `OMGLOL_KEY` (your API key), `TRAKT_SLURM` (optional, see [Trakt ](#trakt ) for details)
5. Add your sources in `config.js`
2025-12-18 01:57:14 +00:00
2025-12-25 23:19:35 +00:00
For local development, copy `.env.example` to `.env` with your credentials.
2025-12-18 01:57:14 +00:00
2025-12-25 23:19:35 +00:00
## Basic Example
2025-12-18 01:57:14 +00:00
2025-12-25 23:19:35 +00:00
**Now page template:**
```html
I wrote this: [tktk ](https://your-blog.com )
I watched this: [tktk ](trakt.tv/users/username )
```
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
**config.js:**
```js
2025-12-25 23:34:50 +00:00
export const linkFormat = 'markdown'
2025-12-25 23:19:35 +00:00
export const items = [
{
id: 'blog',
regex: htmlLinkRegex('your-blog.com'),
getLatest: async () => getJsonFeedItemTitle('https://your-blog.com/feed.json'),
},
{
id: 'letterboxd',
regex: htmlLinkRegex('letterboxd.com/username'),
getLatest: async () => getLetterboxdActivity('username', true), // with image
},
{
id: 'trakt-movie',
regex: htmlLinkRegex('trakt.tv/users/username'),
getLatest: async () => getTraktMovie('username', 'your-trakt-id', false), // text only
},
]
```
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
## Configuration
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
### Quick Start
1. **In your Now page** , use service names as link text:
```html
< a href = "service-link" > blog< / a >
< a href = "service-link" > gitlab< / a >
```
2. **In services.js** , find the service and flip `isActive` to `true` :
```javascript
{
id: 'gitlab',
isActive: true, // just change this!
regex: htmlServiceLinkRegex('gitlab'),
feedUrl: 'https://gitlab.com/users/your-username/activity.atom',
feedType: 'atom',
}
```
That's it! No importing, no commenting/uncommenting.
### Files
- **config.js** - Link format setting and filter logic (rarely needs editing)
- **services.js** - All available services with `isActive` flags (edit this to enable/disable services)
- **utils.js** - Generic feed handlers and special service logic
### Service Structure
Each service has:
2025-12-25 23:19:35 +00:00
- `id` : identifier for logs
2025-12-28 17:23:27 +00:00
- `isActive` : `true` to enable, `false` to disable
- `regex` : matches service name in your Now page
- `feedType` : Handler to use (`rss`, `atom` , `json` , or special handler name like `mastodon` )
- `feedUrl` : Direct feed URL (use this for custom feeds without usernames)
- `feedUrlTemplate` : URL template with `{userId}` placeholder (use this for standard services)
- `userId` : Your username/ID (only needed with feedUrlTemplate)
- Extra params as needed (e.g., `instance` , `steamId` , `traktId` , `showImage` )
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
**Note**: Use either `feedUrl` (direct) OR `feedUrlTemplate` + `userId` (template). Both work!
Set `linkFormat` in config.js to `'html'` or `'markdown'` .
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
## Available Functions
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
### Code Activity
- `getSourceTubeActivity(username)` - Forgejo activity on source.tube
- `getGitLabActivity(username)` - GitLab activity feed
- `getCodebergActivity(username)` - Codeberg activity feed
### Content Creation
- `getYouTubeLatestVideo(channelId)` - Latest YouTube video (requires channel ID starting with "UC")
- `getVimeoLatestVideo(username)` - Latest Vimeo video
- `getTwitchLatestStream(channel)` - Latest Twitch stream/VOD (via TwitchRSS, no API key needed)
### Gaming
- `getBackloggdActivity(username, showImage)` - Backloggd game activity with optional cover images
- `getExophaseActivity(username, showImage)` - Multi-platform gaming achievements
- `getSteamRecentlyPlayed(steamId)` - Recently played Steam game (requires STEAM_WEBAPI_KEY)
### Books
- `getGoodreadsActivity(userId, showImage)` - Goodreads activity (requires numeric user ID, not username)
- `getHardcoverActivity(username)` - Currently reading books via GraphQL API
### Music
- `getListenBrainzScrobble(username)` - Latest music scrobble (open source Last.fm alternative)
### Social Media
- `getPixelfedPost(instance, username)` - Latest Pixelfed post from federated instance
- `getBlueskyPost(handle)` - Latest Bluesky post (note: links not clickable in RSS)
### General/Legacy
2025-12-25 23:19:35 +00:00
- `getRSSItemTitle(feedUrl)` - Standard RSS feeds
- `getJsonFeedItemTitle(feedUrl, showImage)` - JSON feeds
- `getLetterboxdActivity(username, showImage)` - Letterboxd activity
- `getTraktEpisode(username, id, showImage)` - Latest TV episode
- `getTraktMovie(username, id, showImage)` - Latest movie
- `getTraktEpisodeAndMovie(username, id, showImage)` - Latest episode and movie combined
- `getMastodonPost(feedUrl)` - Latest non-reply Mastodon post
- `getMalojaScrobble(url)` - Latest music scrobble from [maloja ](https://github.com/krateng/maloja )
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
**Important Notes:**
2025-12-25 23:53:24 +00:00
- `showImage` (defaults to `true` ) controls whether images/posters are included in the output. Set it to `false` to show text only.
- For Last.fm, use `getRSSItemTitle('https://lfm.xiffy.nl/your-username')` (via [lfm.xiffy.nl ](https://lfm.xiffy.nl ))
2025-12-28 17:23:27 +00:00
- **YouTube** requires channel ID (not username), find it in your channel's page source or URL
- **Goodreads** requires numeric user ID (found in profile URL after `/user/show/` )
- **Steam** requires Steam ID 64 (convert at https://steamid.io/)
- **Pixelfed** requires instance domain and username (e.g., `pixelfed.social` , `username` )
## API Keys Setup
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
### Trakt
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
To get your Trakt slurm key, follow these steps:
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
1. Go to your History page on Trakt: `https://trakt.tv/users/your-username/history`
2. There should be an RSS feed icon on the top right of the page. Click it.
3. The URL it shows will look something like this: `https://trakt.tv/users/crankle/history.atom?slurm=your-slurm-key`
4. Copy the `slurm` value from the URL and add it as a secret in your Actions settings named `TRAKT_SLURM` .
2025-12-18 16:28:31 +00:00
2025-12-28 17:23:27 +00:00
### Steam
To get your Steam Web API key:
1. Visit https://steamcommunity.com/dev/apikey
2. Enter a domain name (can be localhost for personal use)
3. Agree to the terms and get your API key
4. Add it to your `.env` file as `STEAM_WEBAPI_KEY` or to Actions secrets
5. Find your Steam ID 64 at https://steamid.io/ (enter your profile URL)
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
## Credits
2025-12-18 16:28:31 +00:00
2025-12-25 23:19:35 +00:00
Original project by [melanie kat ](https://source.tube/melanie/now-updater ). Without her work, this fork would not exist.
2025-12-18 01:57:14 +00:00
2025-12-25 23:34:50 +00:00
Thank you also to [xiffy ](https://github.com/xiffy/lfm ) for the Last.fm scrobble fetching service this uses.
2025-12-18 01:57:14 +00:00
2025-12-25 23:34:50 +00:00
## Support
2025-12-18 01:57:14 +00:00
2025-12-25 23:19:35 +00:00
Did you find this useful like I did? Melanie asks that you donate to [Trans Lifeline ](https://translifeline.org ) or [The Trevor Project ](https://thetrevorproject.org ) if you can. I will also add [Belong To ](https://www.belongto.org ) to that list.