Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mzjp2/link-of-the-day
A package to implement a link-forwarding and scheduling system
https://github.com/mzjp2/link-of-the-day
golang http-server links
Last synced: about 1 month ago
JSON representation
A package to implement a link-forwarding and scheduling system
- Host: GitHub
- URL: https://github.com/mzjp2/link-of-the-day
- Owner: mzjp2
- License: mit
- Created: 2019-10-31T23:15:19.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2019-11-11T02:30:51.000Z (about 5 years ago)
- Last Synced: 2023-03-09T09:10:52.970Z (almost 2 years ago)
- Topics: golang, http-server, links
- Language: Go
- Homepage: http://qb.zainp.com
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# link-of-the-day
## What is link-of-the-day?
Link of the day, well, does what it says on the tin. It redirects a user to a different link every day. I built this for [QuantumBlack](https://quantumblack.com), with the plan to generate a QR code that encodes `qb.zainp.com` (where my version of this is hosted) and build the QR code with post-it notes. People can walk by and scan the QR code and get a different link everyday, where links are crowdsources from employees. We'll see if it catches on...
## Why couldn't you come up with a better name?
I'm a software engineer and a mathematician, that should answer your question...
## How do I run it?
`git clone` the repository, make sure you have Docker :whale: installed, then `docker-compose up` should do it.
## How does it work?
It's a simple Go HTTP server, connected to a Postgres database and backed by the `links` package that retrieves the URL scheduled for the current date, updates the visit count and saves new URLs. I deploy it on [Heroku](https://heroku.com) and manage the domain via [Netlify](https://netlify.com).
A `GET` request will be met with a `301` temporary redirect, to the days scheduled link and a `POST` or `PUT` request, appropriate formatted with `Content-Type application/x-www-form-urlencoded` with data `url=` will save the URL and automatically schedule it for the next available slot, so it's very much first come, first serve.