v2
v2 copied to clipboard
Allow bulk operations for feeds
- [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.
Is there a tutorial on using the API to perform these kind of rare-ish tasks, with some copy-pastable code hopefully?
I would also be curious if anyone has a good solution to this issue.
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)
}
}
}
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)
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))