Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jabor
Jul 16, 2010

#1 Loser at SpaceChem

prom candy posted:

Are these users internal or external?

I'll be honest with you here, a list of similarly-numbered buildings that you have to pick the right one out of with zero additional context sounds like the sort of thing that will show up in a CSB report video five years down the track. It's a really atrocious UI no matter how easy it is to implement.

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance

Jabor posted:

I'll be honest with you here, a list of similarly-numbered buildings that you have to pick the right one out of with zero additional context sounds like the sort of thing that will show up in a CSB report video five years down the track. It's a really atrocious UI no matter how easy it is to implement.

Actually yeah that's a good point. I'm moving to team CSS grid

kiwid
Sep 30, 2013

Jabor posted:

CSB report video

:D

Definitely internal use only.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
is there some new method to turning browser autofill off? I have both autocomplete="off" and role="presentation" on my input and neither are turning autofill off.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

teen phone cutie posted:

is there some new method to turning browser autofill off? I have both autocomplete="off" and role="presentation" on my input and neither are turning autofill off.

Which browser(s)? Is there maybe an extension that is not honoring the attributes?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
just normal chrome, even on incognito with no extensions

just found this SO answer about it:

https://stackoverflow.com/questions/15738259/disabling-chrome-autofill/30976223#30976223

Roadie
Jun 30, 2013
Browsers all actively ignore autocomplete="off" now because banks and the like were abusing it to force people to always manually type passwords.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Roadie posted:

Browsers all actively ignore autocomplete="off" now because banks and the like were abusing it to force people to always manually type passwords.
Many websites abuse JavaScript. Solution: browsers disable JavaScript.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

The Merkinman posted:

Many websites abuse JavaScript. Solution: browsers disable JavaScript.

Inshallah

kiwid
Sep 30, 2013

The Merkinman posted:

Many websites abuse JavaScript. Solution: browsers disable JavaScript.

I'd be ok with this and going back to full page refreshes.

kedo
Nov 27, 2007

Does anyone know what CSS class naming convention this is using? I've never seen it before:

code:
class="LeftNav-button button -red -full"
It's BEM-like, but the "-red" and "-full" sitting there unattached is unfamiliar to me.

Data Graham
Dec 28, 2009

📈📊🍪😋



Is the page being dynamically generated by the backend? That looks to me like the base classname is a variable that's not getting filled in

kedo
Nov 27, 2007

Nope, someone literally just typed those into a class attribute.

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

kedo posted:

Does anyone know what CSS class naming convention this is using? I've never seen it before:

code:
class="LeftNav-button button -red -full"
It's BEM-like, but the "-red" and "-full" sitting there unattached is unfamiliar to me.

It's obviously Kebab CSS.

Overflowing with loads of stuff that seemed a good idea when drunk but rapidly turned into an unhealthy, regrettable mess.

fakemirage
Nov 6, 2012

Can't see the haters.

kiwid posted:

It's BEM-like, but the "-red" and "-full" sitting there unattached is unfamiliar to me.
It reminds me of rscss

Cory Parsnipson
Nov 15, 2015

kedo posted:

Does anyone know what CSS class naming convention this is using? I've never seen it before:

code:
class="LeftNav-button button -red -full"
It's BEM-like, but the "-red" and "-full" sitting there unattached is unfamiliar to me.

Maybe someone did a find and replace that went wrong? Tried to delete a variable and there were some css classes with overlap?

Violator
May 15, 2003


Some frameworks like tailwind use a dash (like ‘-mt-8’ for a negative top margin of 8) to specify negative values. Maybe something related?

Edit: I’m guessing button is the main styling and red and full are modifiers of that style?

kedo
Nov 27, 2007

It's all over the code so it's definitely not a mistake. The SCSS has a lot of this type of thing:

code:
<div class="FooBar -baz"></div>

.FooBar {
  color: red;
  
  &.-baz {
    color: blue
  }
}
so I know it's intentional at least? :shrug:

ynohtna posted:

It's obviously Kebab CSS.

fakemirage posted:

It reminds me of rscss

I think you two are onto something – it's probably a weird combination of both. I don't hate it? But it's always a bit odd to see a naming convention that someone seemingly invented out of whole cloth.

Thanks for the extra brainpower, goons :cheers:

prom candy
Dec 16, 2005

Only I may dance
Seems great until someone adds

code:
.-red {
  font-size: 2em;
}
or whatever to the CSS

Methanar
Sep 26, 2013

by the sex ghost
Should I display higher prices to people with a macos/safari user agent? I'm thinking 10%.

There definitely has to be a correlation with using a perceived premium device and higher disposable income/willingness to spend.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Methanar posted:

Should I display higher prices to people with a macos/safari user agent? I'm thinking 10%.

There definitely has to be a correlation with using a perceived premium device and higher disposable income/willingness to spend.

orbitz used to do 30%.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
jfc please no i only own a mac because my job let me take it heavily discounted when i quit

prom candy
Dec 16, 2005

Only I may dance
I use apple products and I spend money freely so your thesis is pretty sound

Boba Pearl
Dec 27, 2019

by Athanatos
What's the easiest way to build a webcounter that tracks hits from hotlinks. I thought it'd be to just pull the files from my apache logs, because I want to track the hits I get from all over the internet (I hotlink my files all over the internet,) I found this tutorial:

https://techmark.pk/a-good-old-fashioned-perl-log-analyzer/

but I've largely fried my brain trying to figure it out, if there's a simpler way to get what I want done please tell me. I'm using wordpress and cPanel, I'm allowed to install perl modules, and have terminal and FTP access to my host. My access logs are formatted the default way through apache, and I have access to AWSstats, and Analog, neither give me a bit of PHP I can stick into my website, which uses wordpress as a CMS. I didn't think doing one of those dumb counters was going to be so difficuilt.

Can someone give me a bit of help? I'd really appreciate it.

ModeSix
Mar 14, 2009

Boba Pearl posted:

What's the easiest way to build a webcounter that tracks hits from hotlinks. I thought it'd be to just pull the files from my apache logs, because I want to track the hits I get from all over the internet (I hotlink my files all over the internet,) I found this tutorial:

https://techmark.pk/a-good-old-fashioned-perl-log-analyzer/

but I've largely fried my brain trying to figure it out, if there's a simpler way to get what I want done please tell me. I'm using wordpress and cPanel, I'm allowed to install perl modules, and have terminal and FTP access to my host. My access logs are formatted the default way through apache, and I have access to AWSstats, and Analog, neither give me a bit of PHP I can stick into my website, which uses wordpress as a CMS. I didn't think doing one of those dumb counters was going to be so difficuilt.

Can someone give me a bit of help? I'd really appreciate it.

You could probably use a plugin like Traffic to do this without having to build your own solution. Unless you have a reason you want to build it yourself it's probably easier to use an out of the box solution.

https://wordpress.org/plugins/traffic/#description

timp
Sep 19, 2007

Everything is in my control
Lipstick Apathy

Boba Pearl posted:

What's the easiest way to build a webcounter that tracks hits from hotlinks. I thought it'd be to just pull the files from my apache logs, because I want to track the hits I get from all over the internet (I hotlink my files all over the internet,) I found this tutorial:

https://techmark.pk/a-good-old-fashioned-perl-log-analyzer/

but I've largely fried my brain trying to figure it out, if there's a simpler way to get what I want done please tell me. I'm using wordpress and cPanel, I'm allowed to install perl modules, and have terminal and FTP access to my host. My access logs are formatted the default way through apache, and I have access to AWSstats, and Analog, neither give me a bit of PHP I can stick into my website, which uses wordpress as a CMS. I didn't think doing one of those dumb counters was going to be so difficuilt.

Can someone give me a bit of help? I'd really appreciate it.

You sound smarter than me at this, but if I was trying to track a specific action on a website I’d use a Google Tag Manager container.

Boba Pearl
Dec 27, 2019

by Athanatos

timp posted:

You sound smarter than me at this, but if I was trying to track a specific action on a website I’d use a Google Tag Manager container.
Google Tag Manager only works when you load a webpage, which isn't what I am trying to track, but specifically access log when accessing a .png file.

ModeSix posted:

You could probably use a plugin like Traffic to do this without having to build your own solution. Unless you have a reason you want to build it yourself it's probably easier to use an out of the box solution.

https://wordpress.org/plugins/traffic/#description

I have to use the apache logs because hot linking a file doesn't call the wordpress API, and the traffic plugin doesn't have the ability to make the hit counter public facing, I'm going for a very specific neocities web 1.0 look, but I also wanted it to be accurate from my apache logs

kedo
Nov 27, 2007

Are you hot linking images? You can technically hotlink a PHP file that returns an image, eg. https://stackoverflow.com/questions/900207/return-a-php-page-as-an-image Though depending on the site/service where you're hot linking them, they might not allow you to embed a URL ending in .php the same way you might embed a .jpg. But it wouldn't be too hard to integrate an existing PHP stats package and/or roll your own that increments a counter every time a file is called if you're able to go this route.

What's your end goal, how do you want to interact with the tracked data?

Boba Pearl
Dec 27, 2019

by Athanatos
The goal is to show a little ticker on the front page that goes up when someone on the forums, or on my website, or on their rss feeder, sees one of the images I host in a folder on the site.

prom candy
Dec 16, 2005

Only I may dance
Could you do some kind of rewrite where a direct request for an image actually hits a PHP script that logs the view and then renders said image?

i.e. /hello.jpg -> imageViewer.php?image=/hello.jpg

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Just because your URL ends in ".png", that doesn't mean it literally needs to be a png file on the web server that gets returned verbatim. That's an early-2000s way of thinking about the web. It could just as easily be a script that increments a counter in a database and then returns the requested image content.

You don't even need to do URL rewriting or anything, your web server will have a way to say "for any URL matching this path, execute this script instead".

But also your web server probably also supports things like "for any URL matching this path, run this script first, then do your normal file handling afterwards", which means your counting script doesn't even need to handle returning the image content.

Last Chance
Dec 31, 2004

Yeah I’ve always assumed that’s how tracking images in email newsletters works

Boba Pearl
Dec 27, 2019

by Athanatos
That actually cracked my brain, I didn't know that was an option, and I definitely don't know how to do that, but that's basically what I want, is the third option, and then I could just put that number out to a counter on the front page.

What would I google to get started? (I don't want to teach myself, but will.)

Boba Pearl fucked around with this message at 04:11 on Sep 30, 2022

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
This will generally be specific to the webserver you're using. It looks like Apache calls these things filters. You might need to write a custom module for your hit counter, or perhaps there's an existing module that would allow you to write a filter in PHP or some other scripting language. Or maybe someone's already written a hit counting filter module.

Boba Pearl
Dec 27, 2019

by Athanatos
I decided to use a cronjob with awk

code:
rm ../public_html/UniqueHits.txt
cd /logs/
find -name 'bobapearlessence.com-ssl*' -exec cat {} + > buffer.gz
zcat buffer.gz|awk '{print $1}' |sort|uniq|wc -l >> buffer.txt
awk '{s+=$1} END {print s}' buffer.txt >> ../public_html/UniqueHits.txt
rm buffer.txt
rm buffer.gz
Then I just need to

code:
<?php
$number = file_get_contents('../UniqueHits.txt');
echo $number;
?>

Boba Pearl fucked around with this message at 13:40 on Sep 30, 2022

Boba Pearl
Dec 27, 2019

by Athanatos
The actual answer is a cronjob that looks like

code:
cat /home/bobapear/logs/bobapearlessence.com-ssl* >> /home/bobapear/logs/buffer.gz
zcat /home/bobapear/logs/buffer.gz|awk '{print $1}' |sort|uniq|wc -l >> /home/bobapear/logs/buffer.txt
awk '{s+=$1} END {print s}' /home/bobapear/logs/buffer.txt >> ~/public_html/UniqueHits.txt
rm /home/bobapear/logs/buffer.txt
rm /home/bobapear/logs/buffer.gz
Got it working, it was an End of Line error. dos2unix fixed it.

Now I get to make a big gawdy counter that'll look tacky :blessed:

Boba Pearl fucked around with this message at 14:15 on Sep 30, 2022

CarForumPoster
Jun 26, 2013

⚡POWER⚡

prom candy posted:

Could you do some kind of rewrite where a direct request for an image actually hits a PHP script that logs the view and then renders said image?

i.e. /hello.jpg -> imageViewer.php?image=/hello.jpg

This is what I did for tracking pixels with django. I needed to do some ~recon~ and it involved sending an email or otherwise having a webpage loaded such that when the user loaded the jpg I'd get all the HTTP headers n poo poo. It was very easy, just made a route that'd return the jpg but when it did it'd log everything I could potentially know about the requester of the image to a file.


Could do the same but to increment a counter in whichever way was desired.

kedo
Nov 27, 2007

A question for the front-end devs out there – for browser testing purposes, is the MacOS version of Edge close enough to the Windows version that I could just do my Edge testing on MacOS and ignore my Windows environment almost entirely?

I know there are some font rendering differences between Windows and Mac, but as long as the guts of the browser are mostly the same I'm wondering if it makes much of a difference which OS I'm on?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

kedo posted:

A question for the front-end devs out there – for browser testing purposes, is the MacOS version of Edge close enough to the Windows version that I could just do my Edge testing on MacOS and ignore my Windows environment almost entirely?

I know there are some font rendering differences between Windows and Mac, but as long as the guts of the browser are mostly the same I'm wondering if it makes much of a difference which OS I'm on?

I think I can speak for all Mac users when I say "There's Edge for OS X? Why?"

Adbot
ADBOT LOVES YOU

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender
I don't know the answer, but even if it was a good enough replacement, how would you know if/when that no longer becomes the case? It may be worth throwing money at a tooling like https://www.browserstack.com/

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply