Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add expire view count feature #47

Merged

Conversation

0APOCALYPSE0
Copy link
Contributor

Feature - Add expiry view count
#46

image

  • Add feature

@vinyashegde
Copy link
Owner

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

@0APOCALYPSE0
Copy link
Contributor Author

0APOCALYPSE0 commented Oct 2, 2023

@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
Copy link
Owner

vinyashegde commented Oct 4, 2023

@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
Copy link
Contributor Author

@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
Copy link
Owner

@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
Copy link
Contributor Author

@vinyashegde added

off view count
image

on view count
image

@vinyashegde
Copy link
Owner

vinyashegde commented Oct 5, 2023

@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

added toggle button for view count

moved click event from html to js
@0APOCALYPSE0
Copy link
Contributor Author

@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 vinyashegde merged commit 43ce230 into vinyashegde:main Oct 5, 2023
@vinyashegde
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants