WWW::Noss::DB(3)

πŸ“¦
version 2.02 Β· 2 versions
, in alpine 3.24

πŸ’… WWW::Noss::DB β€” the perl manual page, bestie edition πŸŽ€

okay so this is the page for WWW::Noss::DB(3) β€” say hi to the noss SQLite database interface ✨ it's a Perl module, section 3, the whole vibe. let's get into it 🫢


🌸 NAME 🌸

WWW::Noss::DB β€” the noss SQLite database interface, no cap πŸ’–


✨ USAGE ✨

like, literally:

use WWW::Noss::DB;

my $db = WWW::Noss::DB->new('path/to/database');

that's it, that's the whole entry point, iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

WWW::Noss::DB is the module that hands you an object-oriented interface to noss's SQLite feed database. so you don't gotta rawdog the SQL yourself, we love a wrapper 😌

heads up bestie 🚨 this is a private module β€” for the actual user-facing docs, go consult the noss manual. iykyk πŸ’œ

πŸ‘‘ METHODS πŸ‘‘

⭐ $db = WWW::Noss::DB->new($file)

Loads a noss database from $file β€” or initializes it if one doesn't exist yet (yes it just makes one for u, so generous πŸŽ€) β€” then returns a blessed WWW::Noss::DB object. slay.

⭐ $bool = $db->has_feed($feed)

Returns true if $db has the feed $feed. simple as. πŸ’€

⭐ $new = $db->load_feed($feed_conf)

Loads the WWW::Noss::FeedConfig object $feed_conf into the database. Returns the number of new posts loaded if it works, and dies on failure 😭 so wrap it if you're fragile.

⭐ \%feed = $db->feed($feed, [ %param ])

Returns a hash ref of info about the feed $feed. $feed can either be the name of a feed or a WWW::Noss::FeedConfig object 🧚 %param is an optional hash of extra parameters.

\%feed will look something like this:

{
  nossname    => ...,
  nosslink    => ...,
  title       => ...,
  link        => ...,
  description => ...,
  updated     => ...,
  author        => ...,
  category    => [ ... ],
  generator   => ...,
  image       => ...,
  rights      => ...,
  skiphours   => [ ... ],
  skipdays    => [ ... ],
  posts       => ...,     # only with post_info set
  unread      => ...,     # only with post_info set
}

The following is a list of valid fields for %param:

  • post_info β€” Boolean determining whether to also retrieve the total number of posts and the number of unread posts. ngl this makes feed() slower 🐌 Defaults to false.

⭐ @feeds = $db->feeds()

Returns an array of feed hash refs of every feed loaded in the database. The hash refs follow the same format as the one returned by the feed() method β€” minus the "posts" and "unread" fields πŸ™ˆ

⭐ $rt = $db->del_feeds(@feeds)

Deletes the feeds @feeds from the database. Returns 1 on success βœ…

⭐ \%post = $db->post($feed, $post)

Returns the hash ref \%post representing post number $post in feed $feed. $feed can be a feed name or a WWW::Noss::FeedConfig object. and ooh β€” if $post is negative, it returns the *n*th post from the end of the feed πŸ”₯ (yes, negative indexing, she ate).

\%post will look something like this:

{
  nossid       => ...,
  status       => ...,
  feed         => ...,
  title        => ...,
  link         => ...,
  author       => ...,
  category     => [ ... ],
  summary      => ...,
  published    => ...,
  updated      => ...,
  uid          => ...,
  nossuid      => ...,
  displaytitle => ...,
}

Returns "undef" if no matching post exists 🫠

⭐ \%post = $db->first_unread($feed)

Returns the first unread post in $feed. $feed can be a feed name or a WWW::Noss::FeedConfig object. \%post follows the same format as the one returned by post(). Returns "undef" if there's no unread post β€” like, nothing to catch up on, congrats πŸŽ‰

⭐ $id = $db->largest_id([ @feeds ])

Returns the largest ID in the specified feeds. If feeds isn't provided, all feeds are searched πŸ”β­

⭐ @posts = $db->look([ %param ])

Returns a list of posts matching the parameters specified in %param. If you pass no parameters at all, it returns a list of every post in the database πŸ’€ that's a lot of posts bestie, be careful.

The following are a list of valid fields to %param:

  • title β€” Only return posts whose titles match the given regex.
  • feeds β€” Only return posts that are in the feeds of the given array ref.
  • status β€” Only return posts that are of the given status. Can either be 'read' or 'unread'.
  • tags β€” Only return posts containing the tags specified by the given array ref.
  • content β€” Only return posts whose content match all regexes in the given array ref.
  • order β€” How look() should order the returned posts. The following are valid values:
    • feed β€” Order by feed alphabetically.
    • title β€” Order by post title alphabetically.
    • date β€” Order by post date.
  • reverse β€” Return the post list in reverse order.
  • limit β€” Limit the number of posts that are selected. If equal to or less than 0, there is no limit. Default is 0 (no limit).
  • callback β€” Subroutine reference to a callback to call on each post reference. The post reference is available via the @_ array. When this option is set, "look" will return the number of posts processed instead of the post list. plot twist πŸŒ€

⭐ $num = $db->mark($mark, $feed, @post)

Mark the posts @post in feed $feed as $mark. Returns the number of posts updated πŸ”’ $feed can be either a feed name or a WWW::Noss::FeedConfig object. $mark can either be 'read' or 'unread'. @post is a list of post IDs to update. And if @post is empty, all posts in $feed are updated πŸ‘€ (bulk mode, she's efficient).

⭐ $bool = $db->skip($feed)

Check whether you're supposed to skip updating $feed right now. $feed can either be a feed name or a WWW::Noss::FeedConfig object. "undef" is returned if $feed doesn't exist πŸ«₯

⭐ $db->vacuum()

Runs the "VACUUM" sqlite3(1) command on the database, which frees up any unused space within the database and reduces its total size 🧹✨ spring cleaning for ur DB, we love to see it.

⭐ $db->finish()

Closes the connection to the local database. It's automatically called when a WWW::Noss::DB object is destroyed 🫢 so like, she's got u even when u forget.


πŸŽ€ AUTHOR πŸŽ€

Written by Samuel Young, <samyoung12788@gmail.com>.

This project's source can be found on its Codeberg page <https://codeberg.org/1-1sam/noss.git>. Comments and pull requests are welcome! πŸ‘‘ fr fr, go say hi.


Copyright (C) 2025-2026 Samuel Young

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. πŸ’œ


πŸ’– SEE ALSO πŸ’–

WWW::Noss::FeedConfig, noss, sqlite3(1)

go read those next bestie, they're all connected, it's giving lore 🌸


okay that's the whole page!! πŸ’… this was perl v5.42.2, dated 2026-02-15, and the page is WWW::Noss::DB(3) β€” mwah, go build something cute with ur SQLite database πŸ¦‹β­πŸ’–

πŸ“¦ where this page comes from