vinyashegde / shorto_url_shorter

A open source Chrome Extension which shortens your urls in one click with a QR code!
MIT License
18 stars 24 forks source link

add expire view count feature #47

Closed 0APOCALYPSE0 closed 11 months ago

0APOCALYPSE0 commented 11 months ago

Feature - Add expiry view count

46

image

vinyashegde commented 11 months ago

@0APOCALYPSE0 can you explain it briefly what do you want to do?

0APOCALYPSE0 commented 11 months ago

@vinyashegde So according to this feature, shorten url will get expire after using few number of times. So for example during the creation of url if user provide 5 as a input in expiry count view input field then that shorten url can only be used for 5 Times only after that it will get expire. In short, now user can decide how many number of times url can be used. After the view/use limit is over then url will get expire. But if user want to generate a url with no expiry then he can leave that field as empty.

Reference: expire_at_views number optional
Number of views the short url will be valid.

I have used expire_at_views property here API docs: https://t.ly/docs

vinyashegde commented 11 months ago

@vinyashegde So according to this feature, shorten url will get expire after using few number of times. So for example during the creation of url if user provide 5 as a input in expiry count view input field then that shorten url can only be used for 5 Times only after that it will get expire. In short, now user can decide how many number of times url can be used. After the view/use limit is over then url will get expire. But if user want to generate a url with no expiry then he can leave that field as empty.

Reference: expire_at_views number optional Number of views the short url will be valid.

I have used expire_at_views property here API docs: https://t.ly/docs

@0APOCALYPSE0 i checked your pr the feature isn't working

0APOCALYPSE0 commented 11 months ago

@vinyashegde it should work. I noticed one thing so suppose if you are passing n number then it will expire after n+1 example: pass 3 as a input and you can can use them link 4 times after 4 times it will expire. I don't know why api expire url after n+1 times instead of after n times

vinyashegde commented 11 months ago

@0APOCALYPSE0 can you make some small changes make a button to enable the view count input field and disable on hide it as optional

0APOCALYPSE0 commented 11 months ago

@vinyashegde added

off view count image

on view count image

vinyashegde commented 11 months ago

@0APOCALYPSE0 i checked your pr the toggle button was not working. I checked it on multiple browsers still its the same Screenshot 2023-10-05 211346

Fix it! also there's an error in the extension

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present. Screenshot 2023-10-05 211920

0APOCALYPSE0 commented 11 months ago

@vinyashegde I have moved inline event to js now you will not get extension error For me toggle button is working. here attaching the video: ezgif com-video-to-gif

Can you tell me the steps how are you testing?

vinyashegde commented 11 months ago

@0APOCALYPSE0 amazing work🚀 and good luck for the hacktoberfest!!