-
Notifications
You must be signed in to change notification settings - Fork 23
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
Find a way if there's a web-hook to auto update /r/web_design's css with an update from this repo. #5
Comments
This is definitely possible with some sort of continuous integration program. All we'd need is a server (Heroku would work) and another Reddit account with mod privileges on /r/web_design You'd also have to go through what you do to manually update it: I notice things like |
That's reddit's placeholders for images you upload to their CDN (amazon). |
So does anything need to be done to that between GitHub and Reddit? Or is it as simple as clicking upload on Reddit with the exact same file as is here? |
That's what I've been doing. I'm not sure what Julian has going on. I just copy the raw and then comment the commit ID to the comment section for revision purposes. I think Julian was wanting something to auto-update the stylesheet if we made a commit here. I'm not sure. We'll have to wait until Julian comments. |
Alright, that sounds simple enough - it'd be easy to automate that if we had a server |
I do reseller hosting and obviously have my own website. So, as long as shared hosting is a viable server then we have one. I have no experience with Heroku though. |
@Swadq gave you some flair on /r/web_design for your work. :) Nice to have a non-mod contributing. |
As long as there's the facility to run a cron job, it'd be fine. All the functionality could be written in PHP. Ideally the CSS should be run through a validator being put on Reddit, but that can be worked in too. Sadly there's nothing we can really do besides that as far as "unit testing" goes. The way I see it is there'd be a cron job running every 15 minutes that does the following
Also, thanks! |
Just set up a cron job successfully last week, so it's possible. |
I'm happy to code it, I'll get it set up on a subreddit of my own and commit it here when it works |
Let me see if I can loop in automod's devs… |
Good idea |
/r/AutoModerator mod here. I don't develop AutoModerator (that's entirely /u/Deimorz) but I can tell you that updating from a 3rd-party-anything is outside the scope of AutoModerator's capabilities. |
@Swadq are you still interested in doing this? |
deploy.io offers such functions if you want to give that a try. |
@W3D3 I couldn't check it out, it's still private. |
@JulianNorton sorry, wrong link: http://dploy.io/ |
@W3D3 |
@JulianNorton Looked into it a bit more, would be easier if there was just a simple hook in github which would send a POST request to a server (I could host) running a simple php script accessing the reddit api at /r/web_design/api/subreddit_stylesheet and updating the css there. I'll code it if i have time. |
@W3D3 Cool, let me know how that goes! |
@W3D3 is right about using a hook (GitHub's Webhooks API). |
@JohnnyDeuss by all means! If you can can it working, I'll figure out how to host it. |
I have a hosting company. I can do it.
|
I've got the script working, it automatically updates the stylesheet and syncs the assets folder with the reddit image.
Am I correct in assuming that noresults is not in the repo and was added manually? |
@JohnnyDeuss |
Seems to work properly. But it does looks like the assets on reddit are not the same as those on GitHub. |
Do I need to do anything still? |
@purduekenny The script is already on a GitHub repo of mine, so you can already set it up on a server. |
I think a pull request is a good idea. Your thoughts Julian? On Tue, May 3, 2016 at 1:25 PM Johnny Deuss notifications@github.com
|
pull away! On Tue, May 3, 2016 at 2:20 PM Kenny Wilson notifications@github.com
|
@JohnnyDeuss I'm not getting it to work. I'm probably doing something wrong, but I'm not sure what. Would you want FTP access to the server I'm putting it on so you can set it up and then I go in and update it with my mod credentials? Also, what's your reddit username? I'd like to give you credit for your work. |
I could definitely do it, but the problem is that I would both need access to the GitHub repo to set up the webhook and access to a reddit account to set up script authorization. Also, my reddit username is /u/BitwiseShift. |
Actually, if you give me FTP access I can probably pinpoint what is wrong. |
@purduekenny what's the status on this? |
I flaked. Will follow up today via PM on reddit. |
Sent @JohnnyDeuss a PM with the information to the server. From what I understand, it's in his hands now until I need to add my credentials to it. |
Looking at the error log it's immediately clear that the script didn't work on the server because it used the <=> from PHP 7, while the server is running 5.6.20, easy fix. I don't know if you've looked at the comment block at the top of config.php, as it explains what you need to do to get it to work, like having access to git. |
I guess I"m a little dense. I haven't used reddit or github API before. I did read through your comments (great job by the way - I'm probably using it as an example for my team in the coming months), but I took the secret as an optional field and I didn't see any other way to give it access to git - so I assumed it was publicly available. I did go through the reddit section and create a reddit app for it, provided a token and a key along with my username and password. Also, I updated PHP to 7. Let me know if I can do anything else to help you along. |
Related to this, wouldn't it be better to store the raw version of the css here, and minimise the css in a build step? (also related to #57 not being able to properly see the diff) |
Yes, minifying css something us owners can do manually if necessary. |
No description provided.
The text was updated successfully, but these errors were encountered: