BenOckmore: In BB-151, from "simplified editing form" do you mean showing some kind of modal having different form fields for edition/creator_name/publisher_title/work prefilled from scraped data?
also i suppose having a extension would be more suitable here and we can also extend it to other websites too!
2022-01-27 02715, 2022
Shubh
but only downside i can think of would be it is browser specific, but then also we only need to make changes to browser specific api code to port to other browsers. what do you think?
2022-01-27 02709, 2022
aerozol has quit
2022-01-27 02748, 2022
monkey
Shubh: Regarding browser compatibility, we can develop what's called userscripts. They are basically small JS scripts that can be run to interact with a page. Then there are browser extensions to run said userscripts like greasemonkey or tampermonkey. That takes care of compatiblity issues.
I think that's a great way to start implementing such features: develop and refine userscripts, and if the community decides it should be added to the website's features (and it is legally OK to do so) then we can adapt it. It would all be javascript so not a lot of work to incorporate I'd imagine.
2022-01-27 02727, 2022
monkey
The MusicBrainz community has a long history of using userscripts to improve the website and add features, so a good part of the community would probably feel comfortable with that.
2022-01-27 02731, 2022
BenOckmore
That's exactly what I would've said! ;)
2022-01-27 02711, 2022
Shubh
But using those scripts i suppose would require user to have extension's like tampermonkey, also we are limited on interface part as it would be mostly js.
2022-01-27 02715, 2022
CatQuest
agree re usercript first bits
2022-01-27 02732, 2022
CatQuest
also but also, pls bookdepository before amason
2022-01-27 02737, 2022
CatQuest
most users (atleast power users) already have violent/grease/tamper monkey installed
2022-01-27 02718, 2022
CatQuest
also the great thing about userscripts is that even a fool like *me* ca modify the simplest of them
2022-01-27 02708, 2022
Shubh
userscripts it is, so i have to create the html nodes then append it on document tree for the UI part (like modal), there is no other elegant way to do this, right?
2022-01-27 02713, 2022
monkey
Correct. You do have access to the css on the website, and perhaps some bootstrap javascript methods? Not sure if those are accessible on the window object
2022-01-27 02730, 2022
monkey
BenOckmore: Do you want me to comment on the details I see on the bootstrap3>4 PR, or should I go ahead and fix them?
2022-01-27 02708, 2022
BenOckmore
monkey: happy for you to fix if you'd like to do that
2022-01-27 02724, 2022
BenOckmore
I didn't have as much time on Tuesday as I'd hoped
2022-01-27 02702, 2022
monkey
The couple of things I've seen so far are a one-line change, so i figured it might be better than pestering you considering you've already brought this 99.9% of the way :p
2022-01-27 02710, 2022
BenOckmore
Shubh: it might be useful to have a look at some of the MB userscripts. I'm not sure where the live at the moment but CatQuest probably knows
monkey: one thing I would say, is be careful with one line changes to variables.scss - they can be used in unexpected ways within the bootstrap code. I think that's one of the reasons the grays are the way they are
2022-01-27 02752, 2022
monkey
Roger that.
2022-01-27 02750, 2022
Shubh
Thanks, those MB userscripts definitely is helpful.
2022-01-27 02724, 2022
dgw joined the channel
2022-01-27 02737, 2022
dgw has quit
2022-01-27 02744, 2022
MRiddickW joined the channel
2022-01-27 02739, 2022
Shubh
Hey, kinda a dumb question but how would i oath with mb using script? like what should be the callback url since there is no web server how my script suppose to get those access tokens and in that matter even client tokens.
2022-01-27 02755, 2022
monkey
Shubh: Using auth in a userscript sounds a bit
2022-01-27 02755, 2022
monkey
dubious. What do you need the auth for?
2022-01-27 02715, 2022
Shubh
for posting in behalf of user to bookbrainz (to add entity)...
2022-01-27 02718, 2022
monkey
So for that we're going to want to send the information in the request directly to populate an entity creation page.
2022-01-27 02720, 2022
Shubh
But i suppose BenOckmore want to not redirect user to entity editor form and directly create entity with script.
2022-01-27 02731, 2022
monkey
Currently we only have that feature in place for a couple of data points like for eaxmple to create a relationship with existing entity (see for example the "add work" button on an author page)
2022-01-27 02713, 2022
monkey
I don't think we are going to support directly creating entities with a script. We always want the user to check through and validate a form manually
2022-01-27 02740, 2022
BenOckmore
Shubh: I think you'd want to have the user log in on BB first, or detect a response that says the user isn't logged in and ask them to go log in with a link
2022-01-27 02739, 2022
BenOckmore
It's a shame we don't have the import system completely done because that's perfect for quickly dumping unchecked info into for later review
2022-01-27 02744, 2022
Shubh
If i'm wrong if i made a post req with script to BB it will automatically include session id (if exist) to the header ?
We also recently implemented something similar in ListenBrainz, let me fish out that PR for a good example
2022-01-27 02719, 2022
BenOckmore
Shubh yeah that's a problem if you try to directly submit using the existing entity post requests, but monkey's approach of using the data to pre-fill in the entity editor wouldn't need it. That's not 100% what I had in mind when I put in the JIRA, but probably a better option with the BookBrainz that exists today
2022-01-27 02710, 2022
Shubh
monkey: i suppose that example would require server to have access token?
2022-01-27 02716, 2022
monkey
What it is really is a simple POST request. Scripts creates an invisible form element set to send a POST request to a certain page with some content set: https://github.com/metabrainz/listenbrainz-server…
2022-01-27 02718, 2022
Shubh
there is a ticket for the same i.e pre-filling entity editor with given field values in req.
2022-01-27 02721, 2022
monkey
So there's no need for handling auth; you're only doing an HTTP request for the user; auth will work as usual; if you are logged in browser will use cookies, if not you'll be bounced to a login page
2022-01-27 02752, 2022
Shubh
Yeah thats what i'm thinking so it only works if i submit data using form? or also work with fetch api?
Unfortunately there's no way to programatically make a POST request with fetch, so we're force to use the invisible form trick
2022-01-27 02756, 2022
monkey
One entirely different approach would be for the userscript to work on the entity-editor page. Say a user has filled in an amazon identifier in the entity-editor. A button show up to "import data from Amazon". When clicked, the userscript will pull the necessary data (API request if we can, loading and parsing an html page otherwise) and fills the info in the relevant inputs directly all on the entity-editor.
2022-01-27 02759, 2022
monkey
BenOckmore: FYI, I just updated test.bb with a couple of small styling corrections (and updated from master)