Greasy Fork is available in English.

Discussions » Development

github gist sync

§
Posted: 2023-03-24

I tried to understand what is a best way to write and publish a UserScript.
From what I understand the TamperMonkey suggests few sources of scripts:
* Userscript.Zone which is only search but without any publishing. Interesting that when I published a script it anyway wasn't found by the service.
* The GreasyFork. I was able to publish my script.
* OpenUserJS is something similar.
* Github Gist search by content with ==UserScript==

So I decided to the last one as more familiar. I created my userscript there https://gist.github.com/stokito/a7babfa3c04c92c6c4142581145fe33d

And here is my questions:
Namespace: as far I understood it's better to use a URL to the script's homepage e.g gist

// @namespace https://gist.github.com/stokito/a7babfa3c04c92c6c4142581145fe33d

This should give it an unique id.

supportURL ideally must be a GitHub issues page but gists doesn't have it but at least they have a comments so I used the same gist url:

// @supportURL https://gist.github.com/stokito/a7babfa3c04c92c6c4142581145fe33d

updateURL and downloadURL are something that may be the same, right? What's a difference between them?
If I updated the script then it will have a Last-Modified header renewed and this can be used to check for updates like in wget -N
Can you please clarify difference between these two.
For my script I used a gist download URL for a specific JS file:

// @updateURL https://gist.githubusercontent.com/stokito/a7babfa3c04c92c6c4142581145fe33d/raw/WebDAV.user.js
// @downloadURL https://gist.githubusercontent.com/stokito/a7babfa3c04c92c6c4142581145fe33d/raw/WebDAV.user.js


@author field is not clear which format it uses. For the OpenUserJS they proposed to me "First Lastname (https://openuserjs.org/users/stokito)" but I wish not to depend on their URL. So I used:


// @author Sergey Ponomarev


Now I wish to have a Source Syncing e.g. when I made a commit the GreasyFork will update the script.
I think that ideally I can just specify a git url for my gist e.g.
https://gist.github.com/a7babfa3c04c92c6c4142581145fe33d.git

And then the GreasyFork can sync and fetch only changed lines. But it looks like the source sync works only for GitHub or for a direct download link.
In this case it's not clear why I need the source syncing if the GreasyFork can check itself for @updateURL


And last question: the OpenUserJS.org are completely open source https://github.com/OpenUserJs/OpenUserJS.org and it would be great if you guys collaborate. I found this confusing that we have so many projects: GraceMonkey, Tampermonkey, ViolentMonkey, OpenUserJS, GreasyFork and the Userscript.Zone.
Seriously, why can't you all unite and create a single easy to use service?

Thank you for your work and efforts

§
Posted: 2023-03-24

Found some proposal to merge projects https://github.com/OpenUserJS/OpenUserJS.org/issues/96
Still wondered why this didn't happened yet

Post reply

Sign in to post a reply.