Hey Guys,
First post here,
I am here to introduce a new aspect of a project I am working on(http://ki.tc). An IP logger with CLI in mind. Now, I have taken an API approach to this, so all calls are JSON dependent. Apart from my introduction, I would appreciate new ideas or rather feedback from the community as to further enhance the serviceā¦here goesā¦
Creating a link:
curl -i -H "Content-Type: application/json" -X POST -d '{"url": "http://google.com"}' http://ki.tc/
Response:
{
"url_short": {
"_id": "b24a138a7f1bce6c493bc",
"admin_link": "http://ki.tc/url_shortner/b24a138a7f1bce6c493bc",
"link": "http://ki.tc/d93da",
"time": "Sun, 27 Aug 2017 18:35:16 GMT",
"url": "http://google.com"
}
}
_id
is not retrievable, so save it.
Admin Access:
curl -i -H "Content-Type: application/json" -X GET http://ki.tc/url_shortner/b24a138a7f1bce6c493bc
Response:
{
"_id": "b24a138a7f1bce6c493bc",
"url_build": {
"_id": "b24a138a7f1bce6c493bc",
"admin_link": "http://ki.tc/url_shortner/b24a138a7f1bce6c493bc",
"link": "http://ki.tc/d93da",
"time": "Sun, 27 Aug 2017 18:35:16 GMT",
"url": "http://google.com"
},
"url_id": 194249668
}
Admin access updated(after someone visits the link). Updated with every Access attempt.
{
"2017-08-27 18:39:19": {
"165914": {
"access_id": "ae3c63d61f35",
"access_time": "Sun, 27 Aug 2017 18:39:19 GMT",
"ip_address": "X.X.X.X",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64)"
}
},
"_id": "b24a138a7f1bce6c493bc",
"url_build": {
"_id": "b24a138a7f1bce6c493bc",
"admin_link": "http://ki.tc/url_shortner/b24a138a7f1bce6c493bc",
"link": "http://ki.tc/d93da",
"time": "Sun, 27 Aug 2017 18:35:16 GMT",
"url": "http://google.com"
},
"url_id": 194249668
}
Each access object is nested with a time-of-access key, which in return is nested with an identifier. Not to be confused with access_id
.
Delete Link(DELETE METHOD | admin link)
curl -i -H "Content-Type: application/json" -X DELETE http://ki.tc/url_shortner/b24a138a7f1bce6c493bc
Response:
{
"result": true
}
After finishing, I realized that I spelled shortener wrong shortner
ā¦speechless
Anyways, I would appreciate any feedback, productive or destructiveā¦doesnāt matter as long as it is feedback.
Cheers,