Closed oxalorg closed 4 years ago
Great idea @oxalorg ! Can you think of a serverless but practical approach to implement this?
We can use something like a Google Sheet/Airtable? Also, what would be a good process to take a suggested alternative and merge it into the default list?
Another idea could be to build out multiple list subscriptions (#8), each suggestion becomes a part of the user's own list and then users can make their list public, all these public lists can go to a separate GitHub repo and can be accessed using jsdeliver?
Yes we could probably hook it upto Google sheets/firebase storage/Dynamo DB or some similar free tier service?
In the most simple case you don't even need a backend app to receive the feedback. Just have the browser extension call a special URL and URL Encode the suggestion. Then you have all the data in the access log of the webserver. The server should respond with a simple 200 OK but no content. Then you can analyze the logfiles by simple command line tools ;)
As discussed with @nileshtrivedi and @anirudhvarma12 we're thinking of creating an extension popup that will ask the users to suggest better alternatives for their current site.
This will take them to directly open a Pull Request in-browser to our Github Repo.
The PR should automatically update the entries to the default list. I'm not sure how can we make this easy enough that the user does not need to edit the JSON files himself, he only needs to be logged into GitHub.
Any thoughts on the implementation?
One way to do this, reusing users existing Github login session, would be to use a url like this to create an issue based on the suggestion they enter (into an input box inside the extension popup):
https://github.com/nileshtrivedi/better/issues/new?title=suggestion:+https://gmail.com&body=protonmail.com----Proton+is+awesome
This will open an issue.
We can then have a Github Action trigger on issue creation which will
For using the Github Action, we would need to add package.json so that we can use the actions toolkit.
We will be using the issue trigger
actions/github package will provide a hydrated octokit client that we can use get the default file, update it, create a branch, commit and open the PR.
There seems to be a package octokit-plugin-create-pull-request that might be helpful
@anirudhvarma12 Can we also do something like this:
I haven't done a lot of research around this, maybe you can evaluate if this is a valid approach or not.
This will avoid us having to write any Javascript / action specific code.
github.context.payload.issue;
, found this in the source of an existing action.This should simplify the process, we will still need to write some JS (might as well), but that would probably be only for updating the list.
We should be able to get the github context to pass to the script instead of using the actions toolkit - https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
We can have a popup UI from the extensions button (in the browser toolbar) to open where users of better can suggest an alternative for the current URL.
A simple web service running which grabs these suggestions from all our users (completely anonymously). I'd be happy to host it on one of my servers.
I think the entire strength of this extension lies in the better list, so this could help us get there much faster?
This also adds a more engaging element of "Help build a better internet", as we will actively be taking user recommendations.