Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs: provide URL shortcut to edit observation(s) #165

Open
synrg opened this issue Apr 4, 2022 · 2 comments
Open

obs: provide URL shortcut to edit observation(s) #165

synrg opened this issue Apr 4, 2022 · 2 comments
Labels
enhancement New feature or request obs iNaturalist observations user iNaturalist / Discord users

Comments

@synrg
Copy link
Collaborator

synrg commented Apr 4, 2022

The basic idea is:

  • in DM to the bot, initiate editing mode with ,edit (or ,edit on)
  • thereafter, every ,obs or ,s obs display is automatically filtered to only your own personal observations (i.e. implicit by me in the query)
  • and each display contains a link to edit, e.g.
    • if a single observation, https://www.inaturalist.org/observations/#/edit
    • if multiple observations, https://www.inaturalist.org/edit/batch?o=#,#,#,... for as many observations as are in the current "page" (up to 200 - this URL can be huge, so we might need to use a URL shortener!)
  • multiple pages for > 200 observations can be edited by appending opt page=2, etc.
@synrg
Copy link
Collaborator Author

synrg commented Apr 4, 2022

A way to avoid having to shorten the URL is to batch edit in smaller batches so we don't exceed Discord's embed size limits.

@synrg
Copy link
Collaborator Author

synrg commented Apr 4, 2022

A mockup using EmbedUtils with a very long URL succeeds:

-embed fromdata {
  "title": "test",
  "url": "https://www.inaturalist.org/observations/edit/batch?o=100776209,99797090,99648648,97565024,96872374,96114915,96114910,96114904,96108602,96108601,96108592,95891997,95888512,95379926,95379923,95379917,95379909,95379900,95379895,95377003,95375778,95375777,95298591,95276467,93619848,93603876,93187032,92890194,92890180,92890163,92890160,92409864,90926674,90807269,90381333,90277837,89666566,89615459,89456333,89447510,89405431,89405426,88418423,87458484,87458481,86588628,86588622,86588614,86588607,86588597,86588589,85949794,85949791,85949790,85949789,85949768,85949749,85949738,85949729,85936381,85936373,85936365,85936337,85531755,84870601,84459915,84459172,84453563,81731587,77505646,77505221,77505119,77104336,73978821,62999261,58089423,57026653,55443114,55443108,55441563,53540824,53540032,53539628,52397692,52255796,51953541,51953540,51027411,50724069,50606165,49630524,49630523,47652950,47648907,47087584,46907699,46410618,46406175,45317143,45317141,44810294,44801528,44146709,44007292,44007279,44007278,44007249,44007247,43853876,43575745,43569256,35282003,34477195,34357909,34354370,32617324,32126155,32078894,31500651,31461057,31460970,31460967,31053342,31022282,30653839,30650367,30650364,30600686,30600685,30599936,30599129,30597789,30453834,30269008,30199589,30164590,30164589,30162809,30161555,30057571,30013456,30013380,30013012,30000475,29808214,29807901,29807455,29740728,29606872,29333420,29231557,29230753,29230751,29230748,29211112,29077124,29016266,28969306,28969154,28968773,28967964,28967571,28763468,28634447,28582548,28581999,28581857,28453738,28452488,28402792,28399236,28399233,28392730,28384065,28381285,28327511,28327510,28202236,28201991,28201777,28201290,27709392,27665787,27654572,27294375,27239949,27239110,27179456,27179448,27174011,27172948,27172259,27166270,26996258,26995747,26995073,26994437,26994346,26988750,26981700"
}

image

The result is a very long /edit/batch URL that loads all those observation IDs.

It appears that the only limit to length that might apply here to the URL is the whole Embed can't exceed 6000 characters total. So long as we stick to pages of 200 IDs of up to 10 digits (and sometime in the not too distant future, 11 digits), then the URL will still be well within the limit.

The original use case that led to us recording this idea has seemingly hit a dead end, though: https://forum.inaturalist.org/t/add-missing-api-filters-to-batch-editing/3806/6

While the idea recorded in this issue is still a good one, it doesn't address the problem of batch editing all your "Galls of North America" observations (or some other project) to add an Annotation for Evidence of Presence: Gall, since the batch edit form doesn't support it. So right now, this is a solution waiting for a real-world problem before we consider moving forward with it.

@synrg synrg added enhancement New feature or request obs iNaturalist observations user iNaturalist / Discord users labels Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request obs iNaturalist observations user iNaturalist / Discord users
Projects
None yet
Development

No branches or pull requests

1 participant