-
Notifications
You must be signed in to change notification settings - Fork 6
Create short links for battles #3
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
base: master
Are you sure you want to change the base?
Create short links for battles #3
Conversation
This proposed update creates short links and prints the short links. The $domainname needs to be declared on line 311 and the $customdir needs to be manually created (and optionally changed). This is for easier sharing of battles so the links do not seem quite as spammy. Feel free to view the live example at https://prts.cr/calc/ . This example is planned to be removed after PR is accepted/rejected. This update is intended to be used with a cronjob similar to `0 0 * * * find /public_html/calc/b -depth -type f -atime +10 -delete` which will delete the redirect webpages (in the `b` directory) after they have not been accessed for 10 days, and will run on the first of the month. Keep in mind, everytime the redirect webpage is loaded, it will create a new shortlink, so expect quite a few redirects per actual battle. I am seeing 780B per webpage which is nominal if they are deleted after 10 (or more days) but will possibly be burdensome if they are never deleted. It is currently unknown why the bottom link has moved to the top.
|
In order to reduce the maintenance, I would prefer to use a service for the short links. Bitly is popular. Google, via Firebase, also has a good solution. |
|
It looks like bitly requires paid API access? I'm fairly certain the Firebase option is free. I'll look into it more. @SpectacularVernacular do you want to look into this more? |
|
Yes I certainly do! I'm unfamiliar with either option, I generally create my own short links for these types of projects. I'll start researching the Firebase option (looking at developers documents and attempting to implement it into the code at the aforementioned website). I certainly understand the desire to keep maintenance to a minimum. At the same time, these short links require no maintenance other than a working That being said, I do respect your judgement as the maintainer to avoid the self-hosted option, and will begin pursuing the Firebase research. In the meantime, I am looking into another service that is free. It is known as Cuttly, and it has a much easy to read API documentation (It is much shorter and all on one page). If you don't think they meet your standards, I will of course drop that idea |
|
The nice thing about Google or Firebase is that the service should be around for years to come. |
Yup, am familiar. For s simple case like this a cron is fine but if I'm not monitoring this and something goes wrong ... it becomes a hassle. An external service eliminates the need for continuing devops. |
|
I've looked into Firebase's documentation now. It seems they are going to require me to set an NS type A record and running Google's code on my site. With Google's egregious privacy record (and other thing I dislike about google) that is not something I am willing to do at this time. I completely understand if you want to use Firebase specifically, and I'll assist on the coding side where I can. If you're not set on using Firebase or Google's technologies, then we can look at other alternatives as well. |
This is only the case if you want a custom domain. In fact for the development on this, everything should be configurable anyway. I'm not going to hardcode API keys in the source code nor the parameters that we pass into the api. Here are the API docs: https://firebase.google.com/docs/dynamic-links/rest Also, whatever your opinion may be about Google for consumers, know that Google is really good to their developer community. |
This proposed update creates short links and prints the short links. The $domainname needs to be declared on line 311 and the $customdir needs to be manually created (and optionally changed). This is for easier sharing of battles so the links do not seem quite as spammy.
Feel free to view the live example at https://prts.cr/calc/ . This example is planned to be removed after PR is accepted/rejected.
This update is intended to be used with a cronjob similar to
0 0 * * * find /public_html/calc/b -depth -type f -atime +10 -deletewhich will delete the redirect webpages (in thebdirectory) after they have not been accessed for 10 days, and will run on the first of the month. Keep in mind, everytime the redirect webpage is loaded, it will create a new shortlink, so expect quite a few redirects per actual battle.I am seeing 780B per webpage which is nominal if they are deleted after 10 (or more days) but will possibly be burdensome if they are never deleted.
It is currently unknown why the bottom link has moved to the top.