guysoft / FullPageOS

A raspberrypi distro to display a full page browser on boot
GNU General Public License v3.0
3.78k stars 227 forks source link

Add user-agent (curl) #495

Closed nikolaev-rd closed 4 months ago

nikolaev-rd commented 4 months ago

While trying to create a simple clock kiosk using this site: https://time.is/clock/Moscow found, that in case curl requests are forbidden:

curl -sL -b cookiefile -w "%{http_code}\\n"  https://time.is/clock/Moscow -o /dev/null
403

Details:

curl -L https://time.is/clock/Moscow
<h1 style="font-family:sans-serif;padding:20px">Please do not scrape our pages! Thanks!</h1>

This is confusing, I didn’t even immediately understand why I only had a black screen and a mouse cursor, found this related issue: https://github.com/guysoft/FullPageOS/issues/405

Maybe this will be helpfull for someone else.

nikolaev-rd commented 4 months ago

Btw, this tutorial is too complicated: https://www.raspberrypi.com/tutorials/how-to-use-a-raspberry-pi-in-kiosk-mode/ It can be replaced with only 3 simple steps:

  1. Install FullPageOS (can be pre-configured via Imager) on SD card
  2. Edit file /boot/fullpageos.txt (insert https://time.is/clock)
  3. Launch your PRi

Profit!

guysoft commented 4 months ago

@nikolaev-rd Thanks for your contribution! I would suggest though to change the user agent to a linux machine, since this is a linux machine and that I would like it to show up as one on world statistics.

    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

BTW according to here it shows up as x86_64 I can change it or you are welcome to update the PR (will get merged faster)

Regarding your second comment: I will just point out that when I posted this OS on Raspeberrpy Pi forms 9 years ago this is the reaction I got: https://forums.raspberrypi.com/viewtopic.php?p=830989#p830989 So I am happy the trend is that this is useful. And noways its on the official raspberrypi image :) Also that guide does not take in to account the screen goes blank after 30 minutes.

nikolaev-rd commented 4 months ago

Regarding your second comment: I will just point out that when I posted this OS on Raspeberrpy Pi forms 9 years ago this is the reaction I got: https://forums.raspberrypi.com/viewtopic.php?p=830989#p830989

I read this, and there is a lot of things that need to be done to get it started for kweb: https://forums.raspberrypi.com/viewtopic.php?t=40860 Last changes 10 years ago! https://github.com/ekapujiw2002/kweb