Share your repls and programming experiences

← Back to all posts
Display view count on a post
ironblockhd

https://testcounter.ironblockhd.repl.co/c/2897ec429b2d First, you need to generate your image codes on https://testcounter.ironblockhd.repl.co.
You can embed the first image where you want to show the count. The second image is invisible, rendering it will increment the total count.

This post has https://testcounter.ironblockhd.repl.co/v/2897ec429b2d views (reset due to botters lol)

Voters
mhamrick23
stoporinjail
programmeruser
AgastyaSandhuja
RolandJLevy
ARJPEG
aflacc
Leroy01010
gibbsfreenergy
Aidan0626
Comments
hotnewtop
AmazingMech2418

I totally didn't just bot it. LOL!

ironblockhd

Hehe you only have to bot the /c/ one

AmazingMech2418

@ironblockhd Yeah. I know, but I still botted it...

AmazingMech2418

@ironblockhd Congratulations on 5092 views by the way! LOL!

ironblockhd

Nice haha

HahaYes

@AmazingMech2418 SO MECH Where ARE YOU

AmazingMech2418
StringentDev

I just used it on my post ;)

HahaYes

This is really cool ironblock!

VivaanSa

https://testcounter.ironblockhd.repl.co/v/1b3769256312

DynamicSquid

What dude this is insane! How'd you make it?

ironblockhd

@DynamicSquid Thanks! i used replits new database and made a simple http server that sends server-generated svg images

DynamicSquid

@ironblockhd oh I see, that's cool! for an update, could you make it so that only one user can view it one time?

ironblockhd

A lot of people have third party cookies deactivated and google chrome plans to disable it by default, so it wouldn't really be worth it

ironblockhd

haha someone botted the views

Leroy01010

I wonder how many people read the comments:

https://testcounter.ironblockhd.repl.co/v/19f41971db75
https://testcounter.ironblockhd.repl.co/c/19f41971db75

Leroy01010

how do you use it

ironblockhd

Embed both codes it gives you, for replit posts etc select markdown and for websites select html

Leroy01010

so i need to copy and paste the code @ironblockhd

ironblockhd

Yep, the code it provies you

Leroy01010

ok thx @ironblockhd

ironblockhd

@Leroy01010 np, sorry for understanding the question wrong at first

Leroy01010

it's ok @ironblockhd

gibbsfreenergy

So how does this work?

ironblockhd

@JosephSanthosh i used replitDB to storage the counts and have a simple server set up that sends dynamically generated svg images. When you embed the image that it gives you it will display the count

gibbsfreenergy

@ironblockhd Oh Ok. So I just embed the image in the code?

gibbsfreenergy

@ironblockhd Did you write all the code in here? How would I have to add this in my code, do I copy each file seperately?

ironblockhd

Yes, both seperatly

gibbsfreenergy
AncientBison

I wonder can i use markdown...
https://testcounter.ironblockhd.repl.co/v/684911bb4285

johndo3

for some reason it doesnt work on my post, https://repl.it/talk/share/A-blog/49129

ironblockhd

You need to add a image for both links, you also need to add [loading..](https://testcounter.ironblockhd.repl.co/c/65ca4caa5a46)

johndo3

@ironblockhd I might need you to help me a bit, the counter works, but can you add repl sign-in to my program?

ironblockhd
Code1Tech
ironblockhd

@Code1Tech thats the link that adds to the count when you render it, here's the link your searching: https://testcounter.ironblockhd.repl.co/v/bdf19bd38de

Kookiez

cool!

adl212

This is awesome! I can add it to my projects!

VivaanSa

https://testcounter.ironblockhd.repl.co/c/1b3769256312
https://testcounter.ironblockhd.repl.co/v/1b3769256312

hg0428

Style the counter, needs more work.

zplusfour


I don't think that 195631 people saw this post
but cool anyway

ironblockhd

Someone botted it lol

zplusfour
ironblockhd

Someone spammed views lololol

Wilke000

Oh wow!

DynamicSquid

https://testcounter.ironblockhd.repl.co/v/4cfd9c912f4d

https://testcounter.ironblockhd.repl.co/c/4cfd9c912f4d

DynamicSquid

actually wait no that's a stupid question sorry

DynamicSquid

Does this work for comments?

Codemonkey51

Cool

VulcanWM

Epic!

MarcusWeinberger

This is very neat!

Kudos

Does anyone else see this error?
TypeError [ERR_INVALID_URL]: Invalid URL: undefined/views
at onParseError (internal/url.js:257:9)
at new URL (internal/url.js:333:5)
at request (https.js:287:30)
at Object.get (https.js:318:15) at req (/home/runner/databaseTempSync.js:4:10)
at Object.<anonymous> (/home/runner/databaseTempSync.js:14:3) at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14) {
input: 'undefined/views',
code: 'ERR_INVALID_URL'
}

ironblockhd

Noooo not the undefined database bug again :( i already made a post on https://repl.it/bugs/p/database-url-returns-undefined but now i think i know the issue

ironblockhd

Works again now for some reason lol

InvisibleOne

Cool