WWW::Noss::DB(3)
π
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 makesfeed()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β Howlook()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 than0, there is no limit. Default is0(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 π
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
- alpine 3.24: perl-www-noss-doc 2.02-r1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms