-
Notifications
You must be signed in to change notification settings - Fork 202
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 Examples #200
Labels
Comments
There is a dropdown in the upper right corner. I generated this one in the demo: https://pigallery2.herokuapp.com/api/gallery/random/?directory=.&recursive=true |
I was hoping for an API where I can see the options to generate the request. I am Ok if it does not exists, it just that I wanted to use that feature. I wanted to do it dynamically rather than using the dropdown menu.
On Wednesday, October 28, 2020, 07:48:43 AM EDT, lbischof <notifications@github.com> wrote:
There is a dropdown in the upper right corner. I generated this one in the demo: https://pigallery2.herokuapp.com/api/gallery/random/?directory=.&recursive=true
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
You should be able to dynamically create the link. It works with HTTP GET.
This file contains the supported parameters:
https://github.com/bpatrik/pigallery2/blob/master/src/common/entities/RandomQueryDTO.ts
This is the middleware that pareses that HTTP GET: request:
https://github.com/bpatrik/pigallery2/blob/ee1ce3402480514f2f6e4c4eee16fb99d92f721f/src/backend/middlewares/GalleryMWs.ts#L117
And here is the business logic for that:
https://github.com/bpatrik/pigallery2/blob/ee1ce3402480514f2f6e4c4eee16fb99d92f721f/src/backend/model/database/sql/GalleryManager.ts#L86
Sorry there is no official API documentation for it, but it should be
simple to reverse engineer it. (You just append the parameter-value
pairs to the end of https://<yourdomain>/api/gallery/random/?
<https://pigallery2.herokuapp.com/api/gallery/random/?directory=.&recursive=true>
with
separating them with a `&`, like:
https://pigallery2.herokuapp.com/api/gallery/random/?directory=.&recursive=true
from
above)
Patrik
Payero <notifications@github.com> ezt írta (időpont: 2020. okt. 28., Sze,
14:23):
… I was hoping for an API where I can see the options to generate the
request. I am Ok if it does not exists, it just that I wanted to use that
feature. I wanted to do it dynamically rather than using the dropdown menu.
On Wednesday, October 28, 2020, 07:48:43 AM EDT, lbischof <
***@***.***> wrote:
There is a dropdown in the upper right corner. I generated this one in the
demo:
https://pigallery2.herokuapp.com/api/gallery/random/?directory=.&recursive=true
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#200 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZKA5QHZUEL3M646ZJ7BWDSNALL3ANCNFSM4TCFXUEQ>
.
|
When I use these links I receive a 404 when the browser requests the favicon. Is it possible to add the default favicon for PiGallery2 to these links? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Patrik,
Huge fan of Pi Gallery 2, it does exactly what I needed to do. After reading some of the features in the README file I saw the ability to get random pictures:
Random photo url
You can generate an url that returns a random photo from your gallery. You can use this feature to develop 3rd party applications, like: changing desktop background
Can you provide information about how to use the API for this and other features? I could not find how to send this request to the server.
Thanks,
Oscar
The text was updated successfully, but these errors were encountered: