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!
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?
aerozol has quit
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.
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.
BenOckmore
That's exactly what I would've said! ;)
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.
CatQuest
agree re usercript first bits
also but also, pls bookdepository before amason
most users (atleast power users) already have violent/grease/tamper monkey installed
also the great thing about userscripts is that even a fool like *me* ca modify the simplest of them
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?
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
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?
BenOckmore
monkey: happy for you to fix if you'd like to do that
I didn't have as much time on Tuesday as I'd hoped
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
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
monkey
Roger that.
Shubh
Thanks, those MB userscripts definitely is helpful.
dgw joined the channel
dgw has quit
MRiddickW joined the channel
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.
monkey
Shubh: Using auth in a userscript sounds a bit
dubious. What do you need the auth for?
Shubh
for posting in behalf of user to bookbrainz (to add entity)...
monkey
So for that we're going to want to send the information in the request directly to populate an entity creation page.
Shubh
But i suppose BenOckmore want to not redirect user to entity editor form and directly create entity with script.
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)
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
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
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
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
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
Shubh
monkey: i suppose that example would require server to have access token?
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-serv...
Shubh
there is a ticket for the same i.e pre-filling entity editor with given field values in req.
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
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
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.
BenOckmore: FYI, I just updated test.bb with a couple of small styling corrections (and updated from master)