TriLinder

joined 2 years ago
[–] [email protected] 1 points 2 years ago (1 children)

Oh, how did I not notice that before? Now should be fixed.

[–] [email protected] 2 points 2 years ago

It's just a simple Flask server. I parse the user-agent using the user_agents Python library, apply some conditionals upon the result, render the image using Pillow and send it to the user.

[–] [email protected] 1 points 2 years ago

Yup, I'm parsing the user agent with the user_agents Python library.

[–] [email protected] 1 points 2 years ago* (last edited 2 years ago) (1 children)

If you wanted to target a specific user, you could always send a DM with the image

[–] [email protected] 2 points 2 years ago

Looks like your home instance hexbear.net is filtering external images.

[–] [email protected] 3 points 2 years ago

Cool, didn't know some Lemmy instances did this

[–] [email protected] 2 points 2 years ago

That's weird. The extension should definitely work with the image, as that's what I used when building this quick demo. Does the content of a site like this update?

[–] [email protected] 2 points 2 years ago

Thought about adding the user's location, but was worried PythonAnywhere could somehow cache the image between multiple people.

[–] [email protected] 1 points 2 years ago

Yeah, I just use whatever the user_agents Python library gives me as user_agent.os.family.

[–] [email protected] 4 points 2 years ago (1 children)

You could also send the image through a DM if you want to find a particular user

[–] [email protected] 3 points 2 years ago (1 children)

The user-agent detection definitely isn’t great. If it doesn't recognize a client, it just says unknown. But that wasn't the main point of the post anyway, this was just meant as a quick proof of concept for anyone curious.

 

Note: This post now archived and as such no longer works

An external image showing your user-agent and the total "hit count"

 

Note: This post now archived and as such no longer works

An external image showing your user-agent and the total "hit count"

 

Note: This post now archived and as such no longer works

An external image showing your user-agent and the total "hit count"

 

Note: This post now archived and as such no longer works

An external image showing your user-agent and the total "hit count"

 

Hello, world

H2

H3

hyperlink https://google.com/

https://example.com/

~~strikethrough~~

quote

  • bullet
  • points
  • are
  • cool
  • a quote inside a bullet point

  • q quote inside other quotes

H~2~O

~small~ ~text~
~small text~

spoilerThis is a spoiler

italic bold

Python code block:

print("Hello, world!")

Typescript code block:

const text = "Hello, world!";

| THIS | IS | A | TABLE | |


|


|


|


| | TABLE | TABLE | TABLE | TABLE | | TABLE | TABLE | TABLE | TABLE |

Hello, world

view more: next ›