Skip to content

Commit

Permalink
chat bot can talk on server side
Browse files Browse the repository at this point in the history
  • Loading branch information
jehovahsays committed Jul 6, 2024
1 parent 9f0c045 commit 89ac65d
Show file tree
Hide file tree
Showing 68 changed files with 785 additions and 1,234 deletions.
29 changes: 23 additions & 6 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
if (file_exists($file_pointer))
{
echo "The file $file_pointer already exists <br>";
echo "<meta name='viewport' content='width=device-width'><a href='./en/$value.html'>$value</a>";
//echo "<script> var msg = new SpeechSynthesisUtterance(' i remember hearing.. the word $value.. before. here.. is... what i found'); window.speechSynthesis.speak(msg); </script>";
//echo "<body onload='loadout()'><script>function loadout(){window.location.href = './en/$value.html'}</script>";
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 "<body onload='loadout()'><script>function loadout(){window.location.href = './index.html'}</script>";
exit();
}
}
Expand Down Expand Up @@ -202,9 +202,26 @@
"<$value>en/$value</$value>\n"
."</root></en></root>");
}
echo "<meta name='viewport' content='width=device-width'>successfully created <br> <a href='./#en/$value.html'>$value</a>";
//echo "<body onload='loadout()'><script>function loadout(){window.location.href = './index.htm'}</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>";
foreach($_POST as $variable => $value)
{
$handle = fopen("./js/chatbot.js", "a");
// load the data and delete the line from the array
$lines = file('./js/chatbot.js');
$last = sizeof($lines) - 1 ;
unset($lines[$last]);
// write the new data to the file
file_put_contents('./js/chatbot.js', $lines);
fwrite($handle,
"\""
. $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'}</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();
?>
52 changes: 0 additions & 52 deletions css/edit.css

This file was deleted.

12 changes: 0 additions & 12 deletions edit.php

This file was deleted.

1 change: 0 additions & 1 deletion en/about.txt

This file was deleted.

11 changes: 11 additions & 0 deletions en/connect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head><meta name="viewport"content="width=device-width">
<style>fieldset{position:absolute;width:88%;height: 88%;}</style>
<title>connect</title>
</head>
<body><fieldset>
<legend>connect</legend><script> var msg = new SpeechSynthesisUtterance('connect'); window.speechSynthesis.speak(msg); </script>
</fieldset>
</body>
<html>
1 change: 1 addition & 0 deletions en/connect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connect
Loading

0 comments on commit 89ac65d

Please sign in to comment.