Allow feeds to be imported by type with Drush

Created on 30 September 2024, 7 months ago

Problem/Motivation

Currently, drush feeds:import only takes a numeric id:

drush feeds:import 1

However, this is hard to remember. It's also hard to write scripts when you have dev/staging/prod servers and the feed numeric id may differ among the servers.

So it would be great if we could import feeds by type as well. For example, drush feeds:import node_feed.

Proposed resolution

If the argument to feeds:import is numeric, do the same as before. If it is a string, process it as a type instead.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇯🇵Japan ptmkenny

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ptmkenny
  • @ptmkenny opened merge request.
  • 🇯🇵Japan ptmkenny

    This adds support for import by type, but only if there is a single feed for that type.

    I can rework all the commands to accept int|string, where int is the fid and string is the type, and then, in the event of a string/type, to loop through all the returned feeds, but I want to know if this is an OK approach for the maintainer before I write the code.

  • 🇳🇱Netherlands megachriz

    Importing feeds by type is already possible with the following command:
    feeds:import-all my_feed_type
    This will however import all feeds of that type. So it doesn't import just a single feed when you've more than one feed of that type.

  • 🇯🇵Japan ptmkenny

    Wow, that's great! Actually that's basically exactly what I proposed implementing, so I'm closing this. Thanks for the quick response!

Production build 0.71.5 2024