Paperless Widget [PHP] #143
Replies: 2 comments 3 replies
-
This looks great, ive been trying to get into API retrieval and have had a devil of a time with CORS. My initial thought was to use python but nomatter what i did, i run into the dreaded CORS problem. Looking at solutions it looks like i need to run it through a proxy to counteract that. Javascript being the same. However looking at your code, php might be an easier answer. Have you run into any CORS issues ? I need to get php working in a standalone docker so i can test to see if your code would work for say mealie, which was my test bed. Looking at your code, i cant see any reason why it wouldnt. Thanks for sharing. |
Beta Was this translation helpful? Give feedback.
-
Hey, first of all thank you :) I had difficulties with authorization at the beginning because I first tried using the "file_get_contents" function. Then I was told that it was the wrong function for getting data from a web API. As I said, I have very little knowledge of PHP. I can tell you that the PHP server runs on the same LXC container as Glance but also in its own Docker. :) |
Beta Was this translation helpful? Give feedback.
-
First of all: I don't really have much of a plan for PHP, but it works :D
The code is certainly not the best and maybe someone would like to improve it or program it in a different language, but I still didn't want to withhold it from you:
In this example I display the number of documents with the tag "Eingang" and the tag "TODO".
The documents with the tag "TODO" are listed.
Tag names and document names are linked and open in a new tab.
To see the setting options, simply look at the parameters in the glance.yml
I'm open to any criticism or suggestions for improvement :)
glance.yml
paperless.php
Beta Was this translation helpful? Give feedback.
All reactions