Chris4K commited on
Commit
4171bd5
·
verified ·
1 Parent(s): 75d52b9

Update random_charactor_generator.py

Browse files
Files changed (1) hide show
  1. random_charactor_generator.py +17 -11
random_charactor_generator.py CHANGED
@@ -37,16 +37,22 @@ class RandomCharatorGeneratorTool(Tool):
37
  def __call__(self, input:str="", *args, **kwargs):
38
 
39
  text = '''
40
- Current time
41
- <span id=time></span>
42
- <script>
43
- var now = new Date();
44
- var hours = now.getHours();
45
- var minutes = now.getMinutes();
46
- var seconds = now.getSeconds();
47
-
48
- // Add the time to a HTML element
49
- document.querySelector('#time').innerText = hours + ':' + minutes + ':' + seconds;"
50
- </script>
 
 
 
 
 
 
51
  '''
52
  return text
 
37
  def __call__(self, input:str="", *args, **kwargs):
38
 
39
  text = '''
40
+ Current time
41
+ <span id="time"></span>
42
+ </div>
43
+ <script>
44
+ function updateTime() {
45
+ var now = new Date();
46
+ var hours = now.getHours();
47
+ var minutes = now.getMinutes();
48
+ var seconds = now.getSeconds();
49
+
50
+ document.getElementById('time').textContent = hours + ':' + minutes + ':' + seconds;
51
+ }
52
+
53
+ window.addEventListener('load', function() {
54
+ setInterval(updateTime, 1000); // Update every second
55
+ });
56
+ </script>
57
  '''
58
  return text