Closed jesus2099 closed 10 years ago
It's not a web hook, but you can provide a URL pointing to the raw version of your file on GitHub, and it will be synced once a day.
Duplicate: https://github.com/JasonBarnabe/greasyfork/issues/4
Still +1 on OAuth with Github, for easy import and instant sync.
Oh cool, i didn’t notice. I will try but maybe it will force update if we go in our admin.
I know next to nothing about OAuth so I can't offer an opinion right now. Will look into it.
Jason, it is not said in https://greasyfork.org/import that it will auto-update everyday, is it the correct place ? Maybe you should add a notice there.
I know next to nothing about OAuth so I can't offer an opinion right now. Will look into it.
This looks interesting... http://www.codecademy.com/tracks/oauth & http://peter-murach.github.io/github/
I see a people going away when knowing it was only updated once a day… I don’t feel strong necessity myself for more but it’s true that when users know that kind of stuff they might, you know, try to find another way…
You're right that webhooks provide a better experience than a sync-once-a-day. It's also easier on the server to sync on demand rather than have to check every day. A problem not yet mentioned is that the sync times for each script is different (it's once-a-day, but not everything at once). If a script requires a library and both were updated on GitHub, then it's possible that one and not the other is updated, which could cause problems.
After doing some investigation and thinking, I think I've figured out how this will work. Let me know if this sounds right:
So this solution will not allow these cases (which I don't see a reason for anyway)
Still not sure what OAuth has to do with anything.
Actually, I can't think of any reason to not display the secret key whenever the user wants to see it, as long as only they can see and they can regenerate if they want. If someone gains access to another person's account, there's nothing the key will give them that being able to update the scripts won't.
It sounds great! Thanks for taking the time to create a great service.
Still not sure what OAuth has to do with anything.
OAuth will make these steps redundant:
In other words, it would allow using the GitHub API to create the webhook?
Couple changes to my long comment above:
Another change. GitHub's "raw" links can be cached for up to 5 minutes depending on the last access, so I'm going to have Greasy Fork only do the sync 5 minutes after the webhook request.
OK, try it out. Instructions are linked to from your user page.
I’m testing the stuff… That COLLECTION HIGHLIGHTER is now WebHooked in the sync tab but has yet to be auto-updated. I updated it today but it still says 6 days ago ATM.
In GitHub's webhook setup screen, it'll list recent requests. What do you see there?
Nevermind, I found the problem. I had to restart delayed_job so it could see the changes I made to the sync lib. I reprocessed your hook requests.
Excellent, I even can see the commit messages in history tab !
I must have done something wrong but I don’t understand why that other script has not jumped to webhook status (still auto updating daily).
There were carriage returns (\r) in your sync URLs, probably from when you imported them. The site split them on \n and you probably had \r\n from being on Windows. I've made the site strip whitespace from the sync URLs and I've updated the existing data.
Likely the carriage returns were fine when making the sync requests, but when doing a search from the webhook, they prevented the scripts from being found.
I just pasted URLs in that textarea with new lines (i’m windows indeed). If you mean it’s repaired and won’t happen again, great, thank you. :)
Another small minor note. You are showing the commit messages separated by “ - ”. Maybe it would be nice to put each one in a html paragraph (p) and to preserve newlines (br) inside each one ?
The changelog right now is just inline text content. I don't think I want to change that.
Ok, no problem, it's already very handy! I think everything works now, doesn't it?
Just waiting for someone else to confirm.
Just waiting for someone else to confirm.
Confirmed ( https://github.com/jerone/UserScripts/commit/caf7525c86b2ef8db632833ae8e0340bd4622212 -> https://greasyfork.org/scripts/54-github-gist-share )
Thanks!
Frankly, a great feature like on open userjs, it would allow those growing number of people using git for their scripts to avoid having to manually update greasy fork each time.