v2 icon indicating copy to clipboard operation
v2 copied to clipboard

Allow bulk operations for feeds

Open fhemberger opened this issue 4 years ago • 5 comments

  • [x] I have read this document: https://miniflux.app/opinionated.html#feature-request

Allow bulk operations for feeds (adding a checkbox before the entry and a select/deselect all checkbox):

  • Refresh feed
  • Remove feed
  • Set Category (see #346)

Example: I imported a OPML file which contained quite an amount of dead links and outdated/unmaintained blogs. It would greatly help if I could select them in the feed list and remove them with a single click instead of having to confirm every single delete action.

fhemberger avatar Jul 04 '21 06:07 fhemberger

Is there a tutorial on using the API to perform these kind of rare-ish tasks, with some copy-pastable code hopefully?

somini avatar Jul 05 '21 23:07 somini

I would also be curious if anyone has a good solution to this issue.

anaxonda avatar Nov 28 '21 16:11 anaxonda

Here's a short Go snippet using the official client

It moves all feeds into the same category.

package main

import (
	"log"

	miniflux "miniflux.app/client"
)

func main() {
	client := miniflux.New("https://your.server", "your.api.key")

	categoryID := int64(3) // look up on Categories page

	feeds, err := client.Feeds()
	if err != nil {
		log.Fatal(err)
	}

	for _, feed := range feeds {
		_, err := client.UpdateFeed(feed.ID, &miniflux.FeedModificationRequest{CategoryID: &categoryID})
		if err != nil {
			log.Fatal(err)
		}
	}
}

leonid-shevtsov avatar Mar 21 '22 13:03 leonid-shevtsov

I had the same problem and solved with this python code

import miniflux

try:
    client = miniflux.Client("https://myfeed.com", "user", "secret")
except Exception as e: print(e)

print("client connected")
feeds = client.get_feeds()
print(f"got {len(feeds)} feeds")
for feed in feeds:
    try:
        id = feed['id']
        print(f"removing feed: {id}")
        client.delete_feed(id)
    except Exception as e: print(e)



dr-moreira avatar Jul 01 '23 22:07 dr-moreira

I used this JavaScript snippet from the browser console on any page with feeds:

const options = {
  method: "POST",
  redirect: "manual",
  headers: {
    "Content-Type": "application/json",
    "X-Csrf-Token": document.querySelector("body").getAttribute("data-csrf-token")
  }
}
const e = Array.from(document.getElementsByClassName("item-meta-icons-remove"))
e.forEach((x,i) => setTimeout(() => fetch(x.children[0].getAttribute("data-url"), options), i*750))

pl4nty avatar Jan 13 '24 04:01 pl4nty