nileshtrivedi / better

Browser extension that suggests better/ethical/local/cheaper alternative products & services than your current tab's URL.
MIT License
89 stars 6 forks source link

idea: crowdsource suggestions from the extenstions popup #23

Closed oxalorg closed 4 years ago

oxalorg commented 4 years ago

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.

nileshtrivedi commented 4 years ago

Great idea @oxalorg ! Can you think of a serverless but practical approach to implement this?

anirudhvarma12 commented 4 years ago

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?

oxalorg commented 4 years ago

Yes we could probably hook it upto Google sheets/firebase storage/Dynamo DB or some similar free tier service?

maxheadroom commented 4 years ago

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 ;)

oxalorg commented 4 years ago

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?

oxalorg commented 4 years ago

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

anirudhvarma12 commented 4 years ago

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

oxalorg commented 4 years ago

@anirudhvarma12 Can we also do something like this:

  1. Github action which runs on issue trigger - the action should get the payload which will contain the title/body (will need to confirm this)
  2. Create a simple bash or python script which takes the issue title+body, parses it and updates the existing defaultlist.json
  3. Run the script from the action
  4. Use https://github.com/marketplace/actions/create-pull-request to create a PR from the changed file by the above script

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.

anirudhvarma12 commented 4 years ago

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