-
Notifications
You must be signed in to change notification settings - Fork 329
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
API endpoint to get metadata of a brew #2638
Comments
You would better off with |
I had a bit of a poke at the library app, it appears that it's just scraping the brew's metadata. Homebrewery doesn't force updates to brews in storage, so older brews may not have every metadata option in the code-fenced metadata block in the brew text - for example, A better API endpoint would be for Homebrewery to implement a However, something to consider for the library app itself is that Homebrewery is completely open source and free, and anyone can run it locally on just about any OS (Windows, macOS, Ubuntu, Debian, FreeBSD, RaspBian, or anything that will run a Docker image), so there is no guarantee that a user's Homebrewery document will always exist at |
Thanks a lot for the helping me with this and even checking out my code, I will check out the It's also good that you told me that older brews might lack some data, I only tested it with a handful of documents so I never ran into problems but others might. I'll change my code to account for that. A As for homebrewery deployments that are not on the |
@DSPaul Is that project still being worked on? Can we get an update? Should we close this issue if its not going to be worked on? |
Yes I am still actively working on the project, and still using the scraping method as I described above. It has proven reliable enough as it hasn't broken in the past year. I would still like to see this implemented so I wouldn't close the issue but given that there is a working workaround, you can treat this as very low priority. |
I am confused as to what do you want in relation to PR deployments, those are temporary domains to test stuff, why would you or any user of your app want to access them? From what i gather, you want a Also, thanks for the very fast reply. |
Awesome, that is exactly what I wanted! Thanks for implementing this. You can go ahead and merge the PR and close this issue as far als I'm concerned. Ps. |
Sorry this took this long, could you share a link to the app? I'm interested. |
Stealing their thunder: https://www.compassapp.info/ |
@DSPaul New api endpoint ready and live |
Awesome, just updated my code to use it, works great |
@DSPaul currently working on implementing a strict CORS policy to the project, so i will need your requests' origin so i can whitelist it. |
Thanks for considering me, but because the requests are made directly by the desktop application, and not a server/website, I'm pretty sure the requests don't have an origin right now. I'll look into it this evening. Maybe I can manually add an origin to the request, and if not I could try to use my own api as a proxy. I'll keep you posted. |
CORS (Cross-Origin Resource Sharing) is a browser-enforced security mechanism, and it specifically applies to requests made by browsers running scripts (e.g., JavaScript) within web pages. Here's how it applies across different contexts:
Why CORS is Browser-SpecificCORS is designed to mitigate risks in browser environments, such as:
Standalone applications and scripts are not vulnerable to these browser-based security issues, which is why CORS is not enforced for them. (per chatGPT, not me) |
Alright, so yeah CORS does not apply to your app, that's one less problem. |
Great, saves me work as well. |
Would you mind providing some contact info, mail or whatever, to contact you in case we need? Should we contact you through disclord or reddit? |
You can reach me on discord |
Your idea:
I am working on a library app that would allow users to import official RPG rulebooks and homebrew content from all over the web into one place where they can sort, filter, ect based on metadata like author, release date, ect. To get metadata for homebrewery documents, I currently scrape the
https://homebrewery.naturalcrit.com/share/:id
endpoint and get the metadata in json format with this little bit of C# codeThis would break easily however if the
client/template.js
file were to be changed so having a new endpoint likehttps://homebrewery.naturalcrit.com/info/:id
that returns all the metadata as json would eliminate this rather janky way of doing it. I'm sure other 3rd party projects could also benefit from this. If there is already a way to do this with the current API, please tell as it isn't really documented anywhere so I could have missed it.The text was updated successfully, but these errors were encountered: