Skip to content
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

Labnol #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.svn
*.pyc
*.pyc
.DS_Store
6 changes: 0 additions & 6 deletions README

This file was deleted.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Google App Engine app that Mirrors the content of URLs you supply. Rewrites the fetched page to mirror all content, including images, Flash, Javascript, CSS, and even favicons. You stay within the cache when you follow links. Useful for pulling load off of slashdotted servers. Also can be used to anonymize web access.

Example live version:

[https://mirrorrr.appspot.com](https://mirrorrr.appspot.com)

Instructions on how to setup your own proxy:

[http://www.hongkiat.com/blog/proxy-with-google-app-engine/](http://www.hongkiat.com/blog/proxy-with-google-app-engine/)

For POST support and other features, see mirrorrr-plus:

[https://code.google.com/p/mirrorrr-plus/](https://code.google.com/p/mirrorrr-plus/)
32 changes: 11 additions & 21 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
application: yourappid
version: secureable
runtime: python27
api_version: 1
threadsafe: true
threadsafe: yes

handlers:
inbound_services:
- warmup

instance_class: F1
automatic_scaling:
min_idle_instances: 1
max_idle_instances: 1
max_concurrent_requests: 40

handlers:
- url: /robots\.txt
static_files: static/robots.txt
upload: static/robots\.txt
Expand All @@ -15,27 +21,11 @@ handlers:
upload: static/favicon\.ico
secure: optional

- url: /static/base(\.[0-9])\.css
static_files: static/base.css
upload: static/base\.css
secure: optional

- url: /static
static_dir: static
secure: optional

- url: /admin
login: admin
script: mirror.app
secure: optional

- url: /cleanup
login: admin
script: mirror.app
secure: optional

- url: /kaboom
login: admin
- url: /_ah/warmup
script: mirror.app
secure: optional

Expand Down
11 changes: 0 additions & 11 deletions cleanup.html

This file was deleted.

11 changes: 0 additions & 11 deletions index.yaml

This file was deleted.

93 changes: 24 additions & 69 deletions main.html
Original file line number Diff line number Diff line change
@@ -1,89 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<title>mirror - ɹoɹɹıɯ</title>
<link rel="stylesheet" href="static/base.2.css" type="text/css" charset="utf-8"/>
<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />
<script type="text/javascript" charset="utf-8">
var activeColor = "#000000";
var disabledColor = "#959595";
var defaultValue = "type url here...";

function loadBox() {
var box = document.getElementById("url_entry");
if (box.value != defaultValue) {
box.style.color = activeColor;
}
}

function focusBox() {
var box = document.getElementById("url_entry");
if (box.value == defaultValue) {
box.value = "";
box.style.color = activeColor;
}
}

function blurBox() {
var box = document.getElementById("url_entry");
if (box.value == "") {
box.style.color = disabledColor;
box.value = defaultValue;
}
}
</script>
<link rel="stylesheet" href="static/base.css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body onload="loadBox();">

<div id="wrapper">
<div id="container">
<body>

<div id="header">
<span>mıɾɾoɾ</span><span>ɿoɿɿim</span>
</div>
<header>
<h1>mıɾɾoɾ - ɹoɹɹıɯ</h1>
</header>

<section>

<div id="form_wrapper">
<form action="" method="get" accept-charset="utf-8">
<form action="" method="GET" accept-charset="utf-8">
<div id="input_wrapper">
<span id="http_prefix">http://</span><input onfocus="focusBox();" onblur="blurBox();" type="text" name="url" value="type url here..." id="url_entry"/><input id="go_button" type="submit" value="Go"/>
<span id="http_prefix">http://</span>
<input type="text" name="url" placeholder="type url here..." id="url_entry" autofocus><input id="go_button" type="submit" value="Go">
</div>
</form>

<div id="warning">
Fair use: All content belongs to the original copyright holders, respectively.
</div>
</div>

<div id="recent">
<div class="header">recent</div>
<div id="recent_entries">
{% for entry in latest_urls %}
<div class="url_container">
<span class="url"><a class="url{{forloop.counter}}" rel="nofollow" href="/{{entry.translated_address}}">{% if entry.display_address %}{{entry.display_address}}{% else %}{{entry.translated_address}}{% endif %}</a></span>
<span class="info url{{forloop.counter}}">{{entry.last_updated|timesince}} ago</span>
</div>
{% endfor %}
</div>
<div id="warning">
Fair use: All content belongs to the original copyright holders, respectively.
</div>

<div class="secure">
{% if secure_url %}<a href="{{secure_url}}">{% endif %}<img src="/static/{% if secure_url %}no{% endif %}lock.png" width="16" height="16"> {% if secure_url %}not secure</a>{% else %}secure{% endif %}
</div>

</div>
</div>
</section>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1725949-3");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<footer class="secure">
{% if secure_url %}
<a href="{{secure_url}}">
{% endif %}
<img src="/static/{% if secure_url %}no{% endif %}lock.png" width="16" height="16">
{% if secure_url %}not secure</a>
{% else %}secure{% endif %}
</footer>

</body>
</html>
Loading