Giter Site home page Giter Site logo

Comments (40)

jrhodkinson avatar jrhodkinson commented on June 14, 2024

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 %%spritesheet%% in the CSS - do you manually replace these or does Reddit?

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

That's reddit's placeholders for images you upload to their CDN (amazon).

from subreddit-css.

jrhodkinson avatar jrhodkinson commented on June 14, 2024

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?

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

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.

from subreddit-css.

jrhodkinson avatar jrhodkinson commented on June 14, 2024

Alright, that sounds simple enough - it'd be easy to automate that if we had a server

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

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.

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

@Swadq gave you some flair on /r/web_design for your work. :) Nice to have a non-mod contributing.

from subreddit-css.

jrhodkinson avatar jrhodkinson commented on June 14, 2024

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

  • Check the current hash on /master, if it's different from the last one, continue
  • Copy the CSS and run it through W3C's validator. If it passes, continue
  • Login to /r/web_design's mod interface (cURL or a headless browser?) and update the CSS, including the hash as a comment
  • Save the hash to some file so we can read it later for the first step

Also, thanks!

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

Just set up a cron job successfully last week, so it's possible.
Who's going to code that? :P
No problem. :D

from subreddit-css.

jrhodkinson avatar jrhodkinson commented on June 14, 2024

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

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

Let me see if I can loop in automod's devs…

from subreddit-css.

jrhodkinson avatar jrhodkinson commented on June 14, 2024

Good idea

from subreddit-css.

BenePronomen avatar BenePronomen commented on June 14, 2024

/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.

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@Swadq are you still interested in doing this?

from subreddit-css.

W3D3 avatar W3D3 commented on June 14, 2024

deploy.io offers such functions if you want to give that a try.

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@W3D3 I couldn't check it out, it's still private.

from subreddit-css.

W3D3 avatar W3D3 commented on June 14, 2024

@JulianNorton sorry, wrong link: http://dploy.io/

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@W3D3
Not sure how to continue.
screen shot 2014-09-19 at 9 46 21 am

from subreddit-css.

W3D3 avatar W3D3 commented on June 14, 2024

@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.

http://www.reddit.com/dev/api#POST_api_subreddit_stylesheet

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@W3D3 Cool, let me know how that goes!

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

@W3D3 is right about using a hook (GitHub's Webhooks API).
I'm willing to code it, but you'll still need a server to host the auto-updating script that gets posted to.
It will also need to have access to git and a moderator account to be able to upload the CSS.

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@JohnnyDeuss by all means! If you can can it working, I'll figure out how to host it.

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

I have a hosting company. I can do it.
On Sun, Apr 24, 2016 at 12:17 AM Julian Norton [email protected]
wrote:

@JohnnyDeuss https://github.com/JohnnyDeuss by all means! If you can
can it working, I'll figure out how to host it.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#5 (comment)

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

I've got the script working, it automatically updates the stylesheet and syncs the assets folder with the reddit image.
I am testing with the css/assets from this repo, but I'm getting:

[line 1823] no image found with name "noresults"
background: transparent url(%%noresults%%) no-repeat 50% 50%;

Am I correct in assuming that noresults is not in the repo and was added manually?

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@JohnnyDeuss
from: https://github.com/Axel--/Naut-for-reddit/tree/master/Images
I think it's a mistake that we didn't include it in our fork, and I've not put it in our own images folder.

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

Seems to work properly. But it does looks like the assets on reddit are not the same as those on GitHub.
This is what I get when I sync everything to my test subreddit.

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

Do I need to do anything still?

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

@purduekenny The script is already on a GitHub repo of mine, so you can already set it up on a server.
The images on this repo are outdated though, or at least not the same as the ones on reddit, so they should be updated here. But as far as the script is concerned, only new/modified images are synced, so you're fine without updating the images for now.
Should I make a pull request or just leave it on my own repo?

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

I think a pull request is a good idea. Your thoughts Julian?

On Tue, May 3, 2016 at 1:25 PM Johnny Deuss [email protected]
wrote:

@purduekenny https://github.com/purduekenny The script is already on a
GitHub repo of mine, so you can already set it up on a server.
The images on this repo are outdated though, or at least not the same as
the ones on reddit, so they should be updated here. But as far as the
script is concerned, only new/modified images are synced, so you're fine
without updating the images for now.
Should I make a pull request or just leave it on my own repo?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#5 (comment)

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

pull away!

On Tue, May 3, 2016 at 2:20 PM Kenny Wilson [email protected]
wrote:

I think a pull request is a good idea. Your thoughts Julian?

On Tue, May 3, 2016 at 1:25 PM Johnny Deuss [email protected]
wrote:

@purduekenny https://github.com/purduekenny The script is already on a
GitHub repo of mine, so you can already set it up on a server.
The images on this repo are outdated though, or at least not the same as
the ones on reddit, so they should be updated here. But as far as the
script is concerned, only new/modified images are synced, so you're fine
without updating the images for now.
Should I make a pull request or just leave it on my own repo?


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
<
#5 (comment)


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#5 (comment)

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

@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.

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

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.
If you want to test what's wrong, you should check the page for that webhook, because GitHub keeps track of all POST data sent to a hook and the reply it gets. The script should be returning some useful error messages that may give a hint as to what is wrong.

Also, my reddit username is /u/BitwiseShift.

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

Actually, if you give me FTP access I can probably pinpoint what is wrong.

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

@purduekenny what's the status on this?

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

I flaked. Will follow up today via PM on reddit.

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

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.

from subreddit-css.

JohnnyDeuss avatar JohnnyDeuss commented on June 14, 2024

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.
After that, it stills needs access to the git command, which is now resulting in a "command not found" error. Tried to see if I could get it to install on my own, but failed, so A+ on security.

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.

from subreddit-css.

purduekenny avatar purduekenny commented on June 14, 2024

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.

from subreddit-css.

Haroenv avatar Haroenv commented on June 14, 2024

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)

from subreddit-css.

JulianNorton avatar JulianNorton commented on June 14, 2024

Yes, minifying css something us owners can do manually if necessary.

from subreddit-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.