arran 🇦🇺

  • 0 Posts
  • 48 Comments
Joined 1 year ago
cake
Cake day: September 23rd, 2023

help-circle




  • I"m not entirely sure on the pdf / epub use case, is that for RSS contents, or RSS referred contents? If it’s referred contents then perhaps use something like Omnivore or a script/plugin.

    I suspect you might be mixing something that’s better done as two different apps into one. Omnivore and similar tools you would probably want an integration for a “read later” tool.

    If it’s the RSS contents you might need to use a script or plugin in an existing tool, or just write something.

    In terms of desktop RSS readers I like, RSSGuard, but currently using Akgregator.

    Miniflux IIRC has integrations for sending things to “read later” tools like “Omnivore” but not many.

    You might find something like mailbrew useful, but if you do perhaps a “send to email” is all you needed?

    You could also publish content directly to imap and use the phone’s mail client which stores things offline too. (You don’t need a full setup for imap.)



  • Gentoo user here. It can be great for dev as you have everything that is required to build the software you’re running assuming you’re trying to produce something using the same base. Ie C++ with Qt for KDE etc.

    It’s also a lot easier to build your own repo and packages with than any dev setup I’ve seen, it’s literally just a text file.

    It does take a while to compile. However you need opinions to use it… Otherwise you will just have useflags enabled on everything. It does require a bit of understanding of how linux is built but the guide does most of the work for you, and it’s easy to install on an existing system. If you’re using btrfs you can install it on a subvolume and try it out easy.

    However I used it during the 00s and 20s… But not the 10s. The difference is that software is moving way too fast for distributions to keep up with, so you will definitely want to build your own ebuilds at some point. Emerge / portage can sometimes cause issues upgrading too. But nothing a btrfs snapshot can’t save you from.



  • Moved from Gentoo to Ubuntu in 2008 as I needed to focus more on my job, moved back to Gentoo in 2022. Snaps were part of it, but really the lack of maintenance and vision around the apt repository was really the issue. More and more I was installing stray debs, or having to use flatpaks / AppImages for what what I wanted the system to manage for me.

    Not that I’ve entirely stopped using flatpaks or AppImages, but the process of creating an ebuild is far simpler than trying to do anything with a deb. For a while I had hope about the ppa, however that became fewer and fewer. I do think that the battle to have a comprehensive software repository is a loosing one because of the way things are currently structured.











  • I asked chatgpt to write a go program for this, this looks roughly correct (I have used both libraries before) obviously this won’t be enough for your particular use case. I imagine you can integrate an RSS feed to your site, however if you’re using something like hugo perhaps output it as a csv.

    Super low effort but a good start I think:

    package main
    
    import (
    	"fmt"
    	"log"
    	"os"
    	"strings"
    	"time"
    
    	git "github.com/go-git/go-git/v5"
    	rss "github.com/jteeuwen/go-pkg-rss"
    )
    
    const (
    	timeout = 5 // timeout in seconds for the RSS feed generation
    )
    
    // Repository represents a git repository with its URL
    type Repository struct {
    	URL string
    }
    
    // Repositories is the list of git repositories
    var Repositories = []Repository{
    	{URL: "https://github.com/owner/repo1"},
    	{URL: "https://github.com/owner/repo2"},
    	// Add more repositories here
    }
    
    // FetchLatestTag fetches the latest tag from a git repository
    func FetchLatestTag(repoURL string) (string, string, error) {
    	// Clone the repository to a temporary directory
    	dir, err := os.MkdirTemp("", "repo")
    	if err != nil {
    		return "", "", err
    	}
    	defer os.RemoveAll(dir)
    
    	_, err = git.PlainClone(dir, true, &git.CloneOptions{
    		URL:      repoURL,
    		Progress: os.Stdout,
    	})
    	if err != nil {
    		return "", "", err
    	}
    
    	repo, err := git.PlainOpen(dir)
    	if err != nil {
    		return "", "", err
    	}
    
    	tags, err := repo.Tags()
    	if err != nil {
    		return "", "", err
    	}
    
    	var latestTag string
    	var latestCommitTime time.Time
    
    	err = tags.ForEach(func(ref *plumbing.Reference) error {
    		tag := ref.Name().Short()
    		commit, err := repo.CommitObject(ref.Hash())
    		if err != nil {
    			return err
    		}
    		if commit.Committer.When.After(latestCommitTime) {
    			latestCommitTime = commit.Committer.When
    			latestTag = tag
    		}
    		return nil
    	})
    	if err != nil {
    		return "", "", err
    	}
    
    	return latestTag, latestCommitTime.Format(time.RFC1123Z), nil
    }
    
    // GenerateRSS generates an RSS feed from the latest tags of the repositories
    func GenerateRSS() string {
    	feed := rss.Feed{
    		Title:       "Latest Tags from Git Repositories",
    		Link:        &rss.Link{Href: "http://example.com/"},
    		Description: "This feed provides the latest tags from a list of git repositories.",
    		Created:     time.Now(),
    	}
    
    	for _, repo := range Repositories {
    		tag, date, err := FetchLatestTag(repo.URL)
    		if err != nil {
    			log.Printf("Error fetching latest tag for repository %s: %v", repo.URL, err)
    			continue
    		}
    		feed.Items = append(feed.Items, &rss.Item{
    			Title:       fmt.Sprintf("Latest tag for %s: %s", repo.URL, tag),
    			Link:        &rss.Link{Href: repo.URL},
    			Description: fmt.Sprintf("The latest tag for repository %s is %s, created on %s.", repo.URL, tag, date),
    			Created:     time.Now(),
    		})
    	}
    
    	var rssFeed strings.Builder
    	rssFeed.WriteString(xml.Header)
    	if err := feed.Write(&rssFeed); err != nil {
    		log.Fatalf("Error generating RSS feed: %v", err)
    	}
    
    	return rssFeed.String()
    }
    
    func main() {
    	rssFeed := GenerateRSS()
    	fmt.Println(rssFeed)
    }