Skip to content
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

Add user-agent (curl) #495

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Add user-agent (curl) #495

merged 2 commits into from
Jan 4, 2024

Conversation

nikolaev-rd
Copy link
Contributor

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: #405

Maybe this will be helpfull for someone else.

@nikolaev-rd
Copy link
Contributor Author

nikolaev-rd commented Jan 4, 2024

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
Copy link
Owner

guysoft commented Jan 4, 2024

@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
Copy link
Contributor Author

nikolaev-rd commented Jan 4, 2024

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

@guysoft guysoft merged commit 762c5d8 into guysoft:devel Jan 4, 2024
@nikolaev-rd nikolaev-rd deleted the patch-1 branch January 4, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants