Skip to content

Commit 2d6ac50

Browse files
committed
Added URL shortener challenge
1 parent e9b61e9 commit 2d6ac50

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

10-url-shortener/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Challenge: Build a URL Shortener
2+
3+
Write a RESTful web application that registers shortened URLs with their full URL counterpart.
4+
5+
When a short URL is requested the application should redirect to the matching full URL.
6+
7+
The goal of this exercise is to play with data persistence and dabble with some HTTP interactions. With that in mind, the focus is not to be feature rich or observe standard web security concerns.
8+
9+
## Requirements
10+
11+
- Your application should persist data in between restarts (you're encouraged to try out [sqlite3][sqlite] in the standard library).
12+
- You may use the web framework of your choice. If you're not sure where to start, check out [Flask][flask] and a decent [introduction][flask_intro].
13+
14+
You have flexibility in how you design the API, but in general:
15+
- Accept the long form of a URL and generate a corresponding short URL that can be requested later.
16+
- The service should redirect to the long URL when the short URL is requested. If the short URL isn't registered the service should respond with an `HTTP 404`.
17+
- *Optional:* keep statistics for each short URL showing information about how many times it has been requested.
18+
19+
20+
[sqlite]: https://docs.python.org/3/library/sqlite3.html
21+
[flask]: http://flask.pocoo.org/
22+
[flask_intro]: https://www.fullstackpython.com/flask.html

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ These are some additional coding challenges to sharpen your Python programming s
1212
0. [Connect Four](https://github.com/PDXPythonPirates/code-challenges/tree/master/07-connect-four/)
1313
0. [Check the Weather](https://github.com/PDXPythonPirates/code-challenges/tree/master/08-weather-check/)
1414
0. [Sudoku Solver](https://github.com/PDXPythonPirates/code-challenges/tree/master/09-sudoku/)
15+
1. [URL Shortener](https://github.com/PDXPythonPirates/code-challenges/tree/master/10-url-shortener/)
1516

1617

1718
## How to Contribute

0 commit comments

Comments
 (0)