-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
169 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.env | ||
assests/screenshot.png | ||
__pycache__/ | ||
|
||
app/static/screenshots/* | ||
!app/static/screenshots/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
run: | ||
python3 app/app.py | ||
.PHONY: run | ||
SITE_PACKAGES := $(shell pip show pip | grep '^Location' | cut -f2 -d':') | ||
run: $(SITE_PACKAGES) | ||
python3 app/app.py | ||
|
||
$(SITE_PACKAGES): requirements.txt | ||
pip install -r requirements.txt | ||
touch requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
body { | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
background-color: #212529; | ||
color: #f8f9fa; | ||
font-family: Helvetica, Verdana, Arial, sans-serif; | ||
font-size: 1em; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
flex-grow: 1; | ||
} | ||
|
||
a { | ||
color: #61dafb; | ||
text-decoration: none; | ||
} | ||
|
||
#spinner { | ||
display: none; | ||
} | ||
|
||
#screenshot { | ||
padding-bottom: 5px; | ||
} | ||
|
||
#screenshot img { | ||
max-width: 100%; | ||
border: 1px solid #343a40; | ||
padding: 5px; | ||
background-color: #343a40; | ||
} | ||
|
||
#expandedUrl { | ||
display: none; | ||
} | ||
|
||
.card { | ||
background-color: #343a40; | ||
margin-bottom: 0; | ||
height: 100%; | ||
} | ||
|
||
.card-header { | ||
background-color: #212529; | ||
} | ||
|
||
.card-footer { | ||
background-color: #212529; | ||
position: static; | ||
width: auto; | ||
padding-top: 1.5em; | ||
} | ||
|
||
.form-control { | ||
background-color: #495057; | ||
color: #f8f9fa; | ||
border-color: #6c757d; | ||
} | ||
|
||
.form-control:focus { | ||
background-color: #343a40; | ||
color: #f8f9fa; | ||
border-color: #61dafb; | ||
box-shadow: 0 0 0 0.25rem rgba(97, 218, 251, 0.25); | ||
} | ||
|
||
.btn-primary { | ||
background-color: #212529; | ||
border-color: #495057; | ||
color: #61dafb; | ||
} | ||
|
||
.btn-primary:hover { | ||
background-color: #495057; | ||
border-color: #6c757d; | ||
color: #61dafb; | ||
} | ||
|
||
.input-group-text { | ||
background-color: #495057; | ||
color: #f8f9fa; | ||
border-color: #6c757d; | ||
} |
File renamed without changes
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,74 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<head> | ||
<title>OnGoing URL Expander</title> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" | ||
crossorigin="anonymous" | ||
/> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous" /> | ||
<link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}"> | ||
<script> | ||
$(document).ready(function () { | ||
$('#expandForm').submit(function (event) { | ||
event.preventDefault(); | ||
var userUrl = $('#urlInput').val(); | ||
$('#expandBtn').prop('disabled', true); | ||
$('#spinner').show(); | ||
$('#expandedUrl').empty(); | ||
$('#screenshot').hide().empty(); | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/', | ||
data: { url: userUrl }, | ||
success: function (response) { | ||
$('#expandedUrl').append($('<a>').attr('href', response).text(response)); | ||
$('#screenshot').append($('<a>').attr('href', response).append($('<img>').attr('src', 'screenshot.png'))).show(); | ||
}, | ||
complete: function () { | ||
$('#spinner').hide(); | ||
$('#expandBtn').prop('disabled', false); | ||
} | ||
}); | ||
$(document).ready(function () { | ||
$('#expandForm').submit(function (event) { | ||
event.preventDefault(); | ||
var userUrl = $('#urlInput').val(); | ||
$('#expandBtn').prop('disabled', true); | ||
$('#spinner').show(); | ||
$('#expandedUrl').empty(); | ||
$('#screenshot').hide().empty(); | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/', | ||
data: { url: userUrl }, | ||
success: function (response) { | ||
$('#expandedUrl').append($('<a>').attr('href', response).text(response)); | ||
$('#screenshot').append($('<a>').attr('href', response).append($('<img>').attr('src', "{{ url_for('static', filename='screenshots/screenshot.png') }}"))).show(); | ||
}, | ||
complete: function () { | ||
$('#spinner').hide(); | ||
$('#expandBtn').prop('disabled', false); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
<style> | ||
a { | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
#spinner { | ||
display: none; | ||
} | ||
#screenshot img { | ||
max-width: 100%; | ||
border: 1px solid #ccc; | ||
padding: 5px; | ||
} | ||
.card-footer { | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container my-5"> | ||
</head> | ||
<body> | ||
<div class="container my-5"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-8"> | ||
<div class="card" style="min-height: 200px;"> | ||
<div class="card-header bg-primary text-white"> | ||
<h1 class="mb-0">OnGoing URL Expander</h1> | ||
</div> | ||
<div class="card-body"> | ||
<form id="expandForm"> | ||
<div class="input-group mb-3"> | ||
<input | ||
type="text" | ||
class="form-control" | ||
id="urlInput" | ||
placeholder="Enter a URL" | ||
/> | ||
<button type="submit" class="btn btn-primary" id="expandBtn"> | ||
Expand | ||
</button> | ||
<span id="spinner" class="input-group-text"> | ||
<span | ||
class="spinner-border spinner-border-sm" | ||
role="status" | ||
aria-hidden="true" | ||
></span> | ||
Loading... | ||
</span> | ||
</div> | ||
<div id="expandedUrl" class="lead text-center">{{ url }}</div> | ||
<div id="screenshot" class="container text-center"></div> | ||
</form> | ||
</div> | ||
<div class="card-footer bg-light"> | ||
<div class="container text-center"> | ||
<div class="row"> | ||
<div class="col"> | ||
<p> | ||
<a href="https://github.com/traefikturkey/ongoing" target="_blank">OnGoing</a> | ||
is a | ||
<a href="https://github.com/traefikturkey" target="_blank">TraefikTurkey</a> | ||
project © {{ current_year }} | ||
</p> | ||
<div class="col-md-8"> | ||
<div class="card" style="min-height: 200px;"> | ||
<div class="card-header"> | ||
<h1 class="mb-0">OnGoing URL Expander</h1> | ||
</div> | ||
<div class="card-body"> | ||
<form id="expandForm"> | ||
<div class="input-group mb-3"> | ||
<input type="text" class="form-control" id="urlInput" value="{{ url }}" placeholder="Enter a URL" /> | ||
<button type="submit" class="btn btn-primary" id="expandBtn"> | ||
Expand | ||
</button> | ||
<span id="spinner" class="input-group-text"> | ||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> | ||
Loading... | ||
</span> | ||
</div> | ||
<div id="expandedUrl" class="lead text-center">{{ url }}</div> | ||
<div id="screenshot" class="container text-center"></div> | ||
</form> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="container text-center"> | ||
<div class="row"> | ||
<div class="col"> | ||
<p> | ||
<a href="https://github.com/traefikturkey/ongoing" target="_blank">OnGoing</a> is a <a href="https://github.com/traefikturkey" target="_blank">TraefikTurkey</a> project © {{ current_year }} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
flask | ||
requests | ||
selenium | ||
pillow | ||
pillow | ||
waitress |