[SOLVED] What do I have to put in my agent string for this site to recognise me as a Slackware user?
LQ Suggestions & FeedbackDo you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Above in the thread I see conflicting information.
One claim is that the string slackware can be added anywhere to the UA, and that the test is case insensitive.
Another claim is that the string Slackware Linux replaces the string Linux in the UA.
What is the actual comparison done by LQ against the UA? Is a regex documented somewhere?
I spend most of my time on agent strings making sure sites CANNOT tell what I am running. The whole concept of letting them KNOW is odd to me.
I mean, considering how they misuse such data.
BTW: you have no control on the client side over how the server end will parse the agent strings. That is under the server admin's control. Most just use some defaults, but even those change as the software updates on the server end. You take your best shot and hope.
The whole concept of letting them KNOW is odd to me.
So that you can get the page that you want from a server. Some websites, some video delivery websites, present different pages, with different source, depending on what user agent you report in your header. Some sites will load without scripts on using an iphone user agent, but not with a desktop agent.
It can definitely be advantageous to report yourself as something that you aren't. Youtube for example, you can search, display youtube pages, with a googlebot user agent, and not let scripts run at all. The result or course is a faster, less bandwith, no adds page delivery.
You are not kidding any web server that is using analytics. That's not the ides for me.
Also, presenting a iphone user agent will get you a playlist.m3u8 in the source, because that's how apple devices work. Where as a linux or windows agent won't. They deliver content differently based on device type.
#!/usr/bin/python
#Get the source with urllib
from urllib import request
#Parse it with soup
from bs4 import BeautifulSoup
#If you want to use args
import sys
#If you want pager in term
from pydoc import pager
#User agent to use
agent1 = ('Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X)'
' AppleWebKit/605.1.15 (KHTML, like Gecko)'
' CriOS/108.0.5359.112 Mobile/15E148 Safari/604.1')
agent2 = ('Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0)'
' Gecko/20100101 Firefox/109.0')
#Make header for urllib to report
header = {
'User-Agent': agent1,
'Accept': 'text/html,application/xhtml+xml,'
'image/avif,image/webp,image/apng,'
'application/signed-exchange;v=b3;q=0.9'
'application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Language': 'en-US,en;q=0.8',
#Get a gzip page from server
#'Accept-Encoding': 'gzip, deflate, br',
#'Content-type': 'application/json'}
#urllib will override and send a close
#'Connection': 'keep-alive'
}
#Simple header
#header = {'User-Agent': agent1}
#Get url of page with input
url = input('Enter/Paste URL :')
#Get url of page with args
#url = str(sys.argv[1])
#Get page, feed it to soup
req = request.Request(url, data=None, headers=header)
html = request.urlopen(req)
soup = BeautifulSoup(html)
#Kill all script and style elements
for script in soup(["script", "style"]):
script.extract()
#Get text of page
text = soup.get_text()
#Break into lines and remove leading/trailing spaces
lines = (line.strip() for line in text.splitlines())
#Break multi-headlines into a line each
chunks = (phrase.strip() for line in lines for phrase in line.split(" "))
#Drop blank lines, space lines
text = '\n\n'.join(chunk for chunk in chunks if chunk)
#Write file and/or output to term
with open('webpage.txt', 'a') as f:
f.write(text)
#Pager for scrolling text in terminal with up/down pgUp/pgDown
pager(text)
And you get text of this page to scroll down with the arrow keys.
You'd rather not advertise what? Your operating system?
Right. By advertising I get to boast that I'm a Slackware user, but it also reveals sensitive information about my computer. I don't want to encourage anyone to mess with my computer.
Personally, I don't give a shit about that because my system is secure. The only worries I'd have with this system is if someone got physical access to it... and even then, it would take someone knowledgeable enough to get past my locks and passwords. That's not going to happen, though. Websites online knowing I'm running Slackware is no danger to me. When I'm not using this system, it's powered down completely.
But anyway, being wise about understanding your risks online is a good thing, so your thoughts on that with regards to your own system are smart.
You are not hiding anything by not reporting a particular user agent. Javascript is more of a threat to your privacy than using a slackware user agent. Loading images, the 1 pixel ones, tracks you more than a user agent does. Windows 11 doesn't even report that anymore. It reports as win10.
Personally, I don't give a shit about that because my system is secure. The only worries I'd have with this system is if someone got physical access to it... and even then, it would take someone knowledgeable enough to get past my locks and passwords. That's not going to happen, though. Websites online knowing I'm running Slackware is no danger to me. When I'm not using this system, it's powered down completely.
But anyway, being wise about understanding your risks online is a good thing, so your thoughts on that with regards to your own system are smart.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.