Skip to content

Commit

Permalink
added #urls back to have short urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jehovahsays committed Jul 10, 2024
1 parent 39cfbc0 commit 46142c5
Show file tree
Hide file tree
Showing 21 changed files with 245 additions and 117 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<br>
to get full experience of website visit<br>
http://morgansbyers.scienceontheweb.net/index.html<br>
# recent updates
i added the #urls back for short urls<br>
merged multiple projects i was working on in this update.<br>
I added SpeechSynthesisUtterance to ELIZA chat bot.<br>
ELIZA is an early natural language processing computer program<br>
Expand Down
54 changes: 50 additions & 4 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
echo "The file $file_pointer already exists <br>";
//echo "<meta name='viewport' content='width=device-width'><a href='./index.html#$value'>$value</a>";
//echo "<script> var msg = new SpeechSynthesisUtterance(' i remember hearing.. the word $value.. before.'); window.speechSynthesis.speak(msg); </script>";
echo "<script> var msg = new SpeechSynthesisUtterance(' i remember hearing.. the word $value.. before.'); window.speechSynthesis.speak(msg); </script>";
echo "<body onload='loadout()'><script>function loadout(){window.location.href = './index.html'}</script>";
exit();
}
Expand Down Expand Up @@ -67,7 +67,7 @@
. "<body>"
. "<a href="
. "\""
. "../index.html"
. "../"
. "\""
. "><button>return to homepage</button></a><br><br>"
. "<br><br>"
Expand All @@ -86,6 +86,50 @@
. "</div>"
. "</body>"
. "<html>");
}

foreach($_POST as $variable => $value)
{
$value = str_replace(' ', '_', $value);
$handle = fopen("./en/$value.txt", "a");
fwrite($handle, "$value"
. "\r\n");
}

foreach($_POST as $variable => $value)
{
$handle = fopen("./en/articles.html", "a");
// load the data and delete the line from the array
$lines = file('./en/articles.html');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./en/articles.html', $lines);
$value = str_replace(' ', '_', $value);
fwrite($handle,
"<li><a data-page="
. "\""
. $value
. "\""
. "class="
. "\""
. "titleInput"
. "\""
. ">"
. $value
. "</a></li>"
. "\n"
. "</ul><script type="
. "\""
."text/javascript"
. "\""
."src="
. "\""
."../js/edit.js"
. "\""
. ">"
."></script>"
. "\r\n");
}

foreach($_POST as $variable => $value)
Expand All @@ -101,6 +145,7 @@
$value = str_replace(' ', '_', $value);
fwrite($handle,
"\""
. "en/"
. $value
. "\""
. ","
Expand Down Expand Up @@ -145,15 +190,16 @@
file_put_contents('./js/chatbot.js', $lines);
fwrite($handle,
"\""
. "en/"
. $value
. "\""
. ","
. "\n"
. "];return responses[Math.floor(Math.random() * responses.length)];};");
}
//echo "<meta name='viewport' content='width=device-width'>successfully created <br> <a href='./index.html#$value'>$value</a>";
echo "<body onload='loadout()'><script>function loadout(){window.location.href = './index.html#intelligence'}</script>";
//echo "<script> var msg = new SpeechSynthesisUtterance('i never heard. that word before!.. i will remember. the word $value for further analysis'); window.speechSynthesis.speak(msg); </script>";
echo "<body onload='loadout()'><script>function loadout(){window.location.href = './index.html'}</script>";
echo "<script> var msg = new SpeechSynthesisUtterance('i never heard. that word before!.. i will remember. the word $value for further analysis'); window.speechSynthesis.speak(msg); </script>";
fclose($handle);
exit();
?>
6 changes: 5 additions & 1 deletion en/articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
href="../css/edit.css"/>
<header>
<body>
<a href="../index.html">return to homepage</a>
<a href="../">return to homepage</a>


<article>
Expand All @@ -32,4 +32,8 @@

<li><a data-page="reviews">reviews</a></li>

<li><a data-page="elizabot">elizabot</a></li>

<li><a data-page="index">index</a></li>

</ul><script type="text/javascript"src="../js/edit.js"></script>
2 changes: 1 addition & 1 deletion en/chatbot.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

</head>
<body style="background-color:white;width:100%;height:90%;">
<a href="../index.html"><button>return to homepage</button></a>
<a href="../"><button>return to homepage</button></a>
<br><br>

<div
Expand Down
2 changes: 1 addition & 1 deletion en/delete.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html><html><head><meta name="viewport"content="width=device-width"><style>/* mobile */p {width:100%; height:100%;position: fixed;padding: 0;margin-top: 200px;top: 0px;left: 0px;}</style><title>delete</title></head><body><a href="../index.html"><button>return to homepage</button></a><br><br><br><br><a href="../delete.php?action=delete&filename=./en/delete.html"><button>delete this page</button></a><div class="p"><p contenteditable="true">click here to define the keyword
<!DOCTYPE html><html><head><meta name="viewport"content="width=device-width"><style>/* mobile */p {width:100%; height:100%;position: fixed;padding: 0;margin-top: 200px;top: 0px;left: 0px;}</style><title>delete</title></head><body><a href="../"><button>return to homepage</button></a><br><br><br><br><a href="../delete.php?action=delete&filename=./en/delete.html"><button>delete this page</button></a><div class="p"><p contenteditable="true">click here to define the keyword
delete</p></div></body><html>
3 changes: 3 additions & 0 deletions en/dictionary.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<a href="../"class="handle">index</a></br>


A


Expand Down
2 changes: 1 addition & 1 deletion en/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</form>
<br>

<a href="../index.html"class="handle">index</a></br>
<a href="../"class="handle">index</a></br>

edit

Expand Down
125 changes: 125 additions & 0 deletions en/elizabot.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Cache-Control" content="private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Clear-Site-Data" content="*">
<meta http-equiv="X-Frame-Options" content="DENY">
<meta http-epuiv="X-XSS-Protection" content="1; mode=block">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' http: https:;
script-src 'self' 'unsafe-inline' 'unsafe-eval' http: https:;
style-src 'self' 'unsafe-inline' http: https:;
img-src data: http: https:;
font-src 'self' http: https:;
connect-src http: https:;
frame-src 'self' http: https:;"/>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="../elizabot.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="../elizadata.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

var eliza = new ElizaBot();
var elizaLines = new Array();

var displayCols = 60;
var displayRows = 20;

function elizaReset() {
eliza.reset();
elizaLines.length = 0;
elizaStep();
}

function elizaStep() {
var f = document.forms.e_form;
var userinput = f.e_input.value;
if (eliza.quit) {
f.e_input.value = '';
if (confirm("This session is over.\nStart over?")) elizaReset();
f.e_input.focus();
return;
}
else if (userinput != '') {
var usr = 'YOU: ' + userinput;
var rpl ='' + eliza.transform(userinput);
elizaLines.push(usr);
elizaLines.push(rpl);
// display nicely
// (fit to textarea with last line free - reserved for extra line caused by word wrap)
var temp = new Array();
var l = 0;
for (var i=elizaLines.length-1; i>=0; i--) {
l += 1 + Math.floor(elizaLines[i].length/displayCols);
if (l >= displayRows) break
else temp.push(elizaLines[i]);
}
elizaLines = temp.reverse();
f.e_display.value = elizaLines.join('\n');
}
else if (elizaLines.length == 0) {
// no input and no saved lines -> output initial
var initial = 'ELIZA: ' + eliza.getInitial();
elizaLines.push(initial);
f.e_display.value = initial + '\n';
}
f.e_input.value = '';
f.e_input.focus();
var msg = new SpeechSynthesisUtterance(rpl);
window.speechSynthesis.speak(msg);

}

//-->
</SCRIPT>

<script
type="text/javascript"
src="../jquery-3.7.1.min.js">
</script>

<link rel="stylesheet" type="text/css" href="../files/main.css">

<meta name="theme-color" media="(prefers-color-scheme: light)" content="cyan" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black" />
<link rel="icon" type="image/png" href="../favicon.ico">
<link rel="shortcut icon" href="../favicon.ico" media="(prefers-color-scheme: dark)"/>
<link rel="shortcut icon" href="../favicon.ico" media="(prefers-color-scheme: light)" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="cyan" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="black" />
<title>elizabot</title>

</head>
<a href="../"class="handle">index</a></br>

<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0" onload="window.setTimeout('elizaReset()',100)"><A NAME="top"></A>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="e_form" onsubmit="elizaStep();return false">
<TR><TD COLSPAN="2">
<TEXTAREA style="width:288px;height:300px;" NAME="e_display" COLS="60" ROWS="20">
</TEXTAREA></TD></TR>
<TR VALIGN="middle">
<TD><INPUT style="width:250px;"
TYPE="text"
NAME="e_input"
SIZE="50"
id="filterInput"
onkeyup="titleInput()"
autocomplete="true"
autocorrect="off"
autocapitalize="off"
spellcheck="true"
x-webkit-speech></TD>
</TR>
</FORM>
</TABLE>

</body>
</html>
1 change: 1 addition & 0 deletions en/elizabot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
elizabot
2 changes: 2 additions & 0 deletions en/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html><html><head><meta name="viewport"content="width=device-width"><style>/* mobile */p {width:100%; height:100%;position: fixed;padding: 0;margin-top: 200px;top: 0px;left: 0px;}</style><title>index</title></head><body><a href="../"><button>return to homepage</button></a><br><br><br><br><a href="../delete.php?action=delete&filename=./en/index.html"><button>delete this page</button></a><div class="p"><p contenteditable="true">click here to define the keyword
index</p></div></body><html>
1 change: 1 addition & 0 deletions en/index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index
2 changes: 1 addition & 1 deletion en/playlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<title>playlist</title>
</head>
<body bgcolor="black">
<a href="../index.html"class="handle">index</a>
<a href="../"class="handle">index</a>
</br><br>
<iframe
class="handle"
Expand Down
1 change: 1 addition & 0 deletions en/reviews.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<center>
<fieldset>
<legend>Reviews</legend>
<a href="../"class="handle">index</a></br>
<br>
<form action="../reviews.php" method="post">
<input id="input" type="text" name="value"
Expand Down
2 changes: 2 additions & 0 deletions en/tagcloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
</head>

<body>
<a href="../"class="handle">index</a></br>

<h1><a href="http://github.com/mcc108/TagCloud">TagCloud.js</a></h1>
<!-- 自定义样式切换 -->
<ul>
Expand Down
2 changes: 1 addition & 1 deletion en/tv.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<title>tv</title>
</head>
<body bgcolor="black">
<a href="../index.html"class="handle">index</a>
<a href="../"class="handle">index</a>
</br><br>
<iframe
class="handle"
Expand Down
19 changes: 19 additions & 0 deletions immunology/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
header_remove( 'X-Powered-By' );
header( 'Cache-control: none, no-cache, private, max-age=0' );
header( 'Pragma: no-cache' );
header( 'Content-Type-Options: nosniff' );
header( 'X-Content-Type-Options: nosniff' );
header( 'XSS-Protection: 1; mode=block' );
header( 'X-XSS-Protection: 1; mode=block' );
header( 'Host: index' );
header( 'description: index' );
header( 'keywords: index' );
header( 'Vary: Accept-Encoding' );
header( 'Expires: 0' );
header( 'Referrer-Policy: same-origin' );
header( 'Accept-Language: en-US,en;q=0.5' );
header( 'Connection: Keep-alive' );
header( 'Location: ../index.html' );
exit();
?>
3 changes: 3 additions & 0 deletions immunology/phpwin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"index": "index.php"
}
Loading

0 comments on commit 46142c5

Please sign in to comment.