<commit_before><?php 
/*
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

require_once("ui.inc");
require_once("urls.inc");

$gTitle = "Add a Site";
$gRurl = ( array_key_exists('rurl', $_GET) ? $_GET['rurl'] : '' );
$gRurl = strtolower($gRurl);
$is_valid_url = false;
if ( $gRurl ) {
	// Do some basic validation
	$is_valid_url = preg_match("/^(http|https):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i", $gRurl);
	if ( FALSE === strpos($gRurl, "/", 10) ) {
		$gRurl .= "/";
	}
}

?>
<!doctype html>
<html>
<head>
<title><?php echo $gTitle ?></title>
<meta charset="UTF-8">

<?php echo headfirst() ?>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>

<body>
<?php echo uiHeader($gTitle); ?>

<?php
if ( $gRurl ) {
	if ( ! $is_valid_url ) {
		echo "<p class=warning>The URL entered is invalid: $gRurl</p>\n";
	}
	else {
		$existingUrl = urlExists($gRurl);
		if ( $existingUrl ) {
			$query = "select max(pageid) as pageid from $gPagesTable where url='$existingUrl';";
			$pageid = doSimpleQuery($query);
			if ( $pageid ) {
				echo "<p class=warning>$gRurl is already in the list of URLs. See the <a href='http://dev.httparchive.org/viewsite.php?pageid=$pageid'>latest results</a>.</p>\n";
			}
			else {
				echo "<p class=warning>$gRurl is already in the list of URLs.</p>\n";
			}
		}
		else {
			addSite($gRurl);  // queue it for adding
			echo "<p class=warning>$gRurl will be added within five business days and will be included in the next crawl after that.</p>\n";
		}
	}
}
?><commit_msg>remove "dev." url<commit_after><?php 
/*
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

require_once("ui.inc");
require_once("urls.inc");

$gTitle = "Add a Site";
$gRurl = ( array_key_exists('rurl', $_GET) ? $_GET['rurl'] : '' );
$gRurl = strtolower($gRurl);
$is_valid_url = false;
if ( $gRurl ) {
	// Do some basic validation
	$is_valid_url = preg_match("/^(http|https):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i", $gRurl);
	if ( FALSE === strpos($gRurl, "/", 10) ) {
		$gRurl .= "/";
	}
}

?>
<!doctype html>
<html>
<head>
<title><?php echo $gTitle ?></title>
<meta charset="UTF-8">

<?php echo headfirst() ?>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>

<body>
<?php echo uiHeader($gTitle); ?>

<?php
if ( $gRurl ) {
	if ( ! $is_valid_url ) {
		echo "<p class=warning>The URL entered is invalid: $gRurl</p>\n";
	}
	else {
		$existingUrl = urlExists($gRurl);
		if ( $existingUrl ) {
			$query = "select max(pageid) as pageid from $gPagesTable where url='$existingUrl';";
			$pageid = doSimpleQuery($query);
			if ( $pageid ) {
				echo "<p class=warning>$gRurl is already in the list of URLs. See the <a href='viewsite.php?pageid=$pageid'>latest results</a>.</p>\n";
			}
			else {
				echo "<p class=warning>$gRurl is already in the list of URLs.</p>\n";
			}
		}
		else {
			addSite($gRurl);  // queue it for adding
			echo "<p class=warning>$gRurl will be added within five business days and will be included in the next crawl after that.</p>\n";
		}
	}
}
?>
{'fraction_non_alphanumeric': 0.17418083271741808, 'fraction_numerical': 0.009361911800936191, 'mean_word_length': 3.9331713244228435, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3246646', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1439, 'n_words': 434}