dronefly icon indicating copy to clipboard operation
dronefly copied to clipboard

last: subcommands for external taxon queries (bonap, etc.)

Open synrg opened this issue 5 years ago • 2 comments

On iNat Discord we currently use the core customcom cog to define search URLs to external systems for taxa. That works reasonably well, but requires a bit of extra work on the part of the user to properly format the URL and type the exact taxon name. This wishlist is for integration with the existing inat last so that those external links can be more conveniently retrieved by the user. Here are a few custom commands we have defined so far:

Command: worms
Author: SyntheticBee#4951 (443127883846647808)
Created: 27/12/2019 09:31:26
Type: Normal
Responses:

- http://www.marinespecies.org/aphia.php?p=taxlist&action=search&tName={0}

Command: potwo
Author: SyntheticBee#4951 (443127883846647808)
Created: 23/12/2019 17:37:21
Type: Normal
Responses:
- http://www.plantsoftheworldonline.org/?q={0}

Command: bonap
Author: SyntheticBee#4951 (443127883846647808)
Created: 19/12/2019 20:12:45
Type: Normal
Responses:
- http://bonap.net/NAPA/TaxonMaps/Genus/County/{0}

In the case of bonap.net in particular, the URL will not work unless the user types the taxon name exactly, with uppercase, e.g.

,bonap Prunella
http://bonap.net/NAPA/TaxonMaps/Genus/County/Prunella

If implemented as an inat last subcommand, the desired output would be:

,taxon self-heals
... embed for Prunella (self-heals) output ...
,last taxon bonap
http://bonap.net/NAPA/TaxonMaps/Genus/County/Prunella

synrg avatar Jan 12 '20 12:01 synrg

Thanks to mws on iNat Discord for this suggestion.

synrg avatar Jan 12 '20 12:01 synrg

Two alternatives to just enhancing last would be:

  1. treat the subcommand as a modifier to the taxon query itself, e.g. ,taxon bonap self-heals would function as a two-stage lookup, first for self-heals, then against bonap to provide the link
  2. alternatively, provide a TaxonConverter and subclass the whole customcom cog to add this as a type hint so that we can write cc's with that converter like ,cc add http://bonap.net/NAPA/TaxonMaps/Genus/County/{0:taxon}

I really like the 2nd idea if it's not too much work. Example usage:

,bonap self-heals
http://bonap.net/NAPA/TaxonMaps/Genus/County/Prunella

synrg avatar Jan 16 '20 09:01 synrg