greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.41k stars 423 forks source link

Help the developer, if they import from the wrong URL #1194

Closed joeytwiddle closed 8 months ago

joeytwiddle commented 8 months ago

Problem

I tried to import some scripts today, but I used the wrong URLs to import

Basically I used this URL:

https://github.com/joeytwiddle/code/tree/master/other/gm_scripts/GitLab_Tweaks/GitLab_Tweaks.user.js

When I should have used:

https://github.com/joeytwiddle/code/raw/master/other/gm_scripts/GitLab_Tweaks/GitLab_Tweaks.user.js

But the error message I got was completely confusing. I actually got this screen. But after trying to add descriptions, they still wouldn't import, and kept coming back to this screen!

Screenshot_20231016_124957

Solutions

  1. Detect https://github.com/[^/]*/[^/]*/tree/ and convert it to .../raw/ automatically. Problem solved.
  2. Alternatively, give the developer some more guidance, because the request to enter descriptions did not solve the problem!
JasonBarnabe commented 8 months ago

https://github.com/joeytwiddle/code/tree/master/other/gm_scripts/GitLab_Tweaks/GitLab_Tweaks.user.js redirects to https://github.com/joeytwiddle/code/blob/master/other/gm_scripts/GitLab_Tweaks/GitLab_Tweaks.user.js, which works if I give it to the importer. I will adjust so both work.