-
Notifications
You must be signed in to change notification settings - Fork 27
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
Simple web form for adding campaigns or news #35
Comments
Sounds interesting. Thinking out loud, could this just be done with some JavaScript? We can't do server side code as the website is hosted in GitHub pages. If this could just be done with JavaScript then I could take a stab at this. |
Yes, I was hoping to have it done just with some Javascript and HTML. Even I am not 100% sure about the feasibility of the task and there might be simpler ways to do it. The intent is to make it simpler to submit news and campaigns. |
I was thinking about this for some time. Pondering into the GitHub resources gives me an idea that we could achieve this either via:
I think I know the right choice for this problem. GitHub seem to have a useful flow-chart (shown below) in their help page about apps: For me the flow-chart leads to "GitHub app" as the solution for the problem in hand. I'm open to other thoughts and opinions, though 🙂 The challenging thing with all the ways is that they require you save some kind of secret to be kept.
Unfortunately, keeping the secret in code (which makes it public) is not a good thing. So, we can't do this simply without some server side code. Heroku's free plan seems promising. May be we could use it to host the application. Any thoughts? 👂 |
@maskaravivek @domdomegg @nicolas-raoul @misaochan Any thoughts? |
A temporary solution could be to make the front end editor bit and it'd just spit out a .json file to upload. I can do this soonish I think. In the future for automating the PRs Heroku (free-tier) or AWS Lambda (the free plan provides 1 million launches/month) would probably work well. Enabling Travis (see commons-app/campaigns#6) should tell us if it will cause any issues with syntax. That PR (the Travis config file) was merged but Travis itself wasn't enabled for the repo - can someone with write-access there enable it at https://travis-ci.com/organizations/commons-app/repositories please. |
Also ideally we'd get the campaigns from commons automatically - is there anywhere where there is a list of campaigns? This is the closest I seem to be able to get, but it's not at all machine readable: https://commons.wikimedia.org/w/index.php?title=Special:AllPages&from=&namespace=460 |
I've accepted the request to enable Travis for the campaigns repo, thanks @domdomegg ! Would anything else be needed? |
I was trying to find this out when we were implementing "display campaigns in app", but unfortunately there did not appear to be any that satisfied our requirements (e.g. start date and end date). That's why we ended up with the campaigns repo. |
@sivaraam This looks good to me at first glance, however it does seem to be a bit more involved than what @domdomegg appears to be planning (albeit perhaps a better long-term option). I definitely agree that we should not store the secret publicly. ;) |
Thanks! Just did some testing, all seems to be working well now 🎉: |
You are correct. I was thinking long term. If you're interested you could make the temporary solution which we could integrate as a sub-page of the website 🙂
I'll think more about the long-term solution using Heroku. Of course, you could give your inputs which I'm most welcome to 🙂
You're correct. Maintaining this repository is hard and we would of course better have an API like interface to get the campaigns. I'll try poking around for it too, to see if I could find anything. May we could ask some help with this in a technical advice IRC meeting |
Just for the sake of completion an initial working version of the campaigns editor (credits: @domdomegg) can be found at https://commons-app.github.io/campaigns-editor Instructions about how to use it to update the campaigns in the campaigns repository could be found in the README of the campaigns repository. |
Now that we maintain our campaigns/news in this repository, it would be useful to have a simple web interface that lets you add a campaign rather than editing the JSON file manually.
Editing it manually requires an understanding of JSON and can also lead to human errors.
To still keep things under our control, the form can simply create a pull request which the collaborators can review and merge.
Github API: https://developer.github.com/v3/pulls/#create-a-pull-request
The text was updated successfully, but these errors were encountered: