aus10powell commited on
Commit
8ba48e6
1 Parent(s): b9928b7

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +25 -16
templates/index.html CHANGED
@@ -13,7 +13,7 @@
13
 
14
  <body>
15
  <div class="page">
16
- <h1>Twitter Account Whimsy</h1>
17
  <div class="form">
18
  <label for="account">Choose the Twitter account you'd like to generate a response to your input:</label>
19
  <select name="account" id="account">
@@ -24,41 +24,39 @@
24
  <option value="cathiedwood">cathiedwood</option>
25
  <option value="ylecun">ylecun</option>
26
  </select>
27
- <link rel="shortcut icon" type="image/x-icon" href="../static/tweepy.ico">
28
  <textarea id="input" placeholder="Enter text here...">Hello world...!?</textarea>
29
- <button id="generate">Generate</button>
30
  <textarea id="output" placeholder="Generated text will appear here..."></textarea>
31
  </div>
32
  <div id="form">
33
- <div id="tweets">
34
- <h2>Latest Tweets (Live)</h2>
35
- <p><i>Just bought Twitter. It's free speech time!</i> - <i>2023-05-14</i></p>
36
- <p><i>Tesla is now accepting Dogecoin as payment.</i> - <i>2023-05-15</i></p>
37
- <p><i>I'm sending a rocket to Mars!</i> - <i>2023-05-16</i></p>
38
- <p><i>I'm building a brain-computer interface.</i> - <i>2023-05-17</i></p>
39
- <p><i>I'm starting a new company to colonize the Moon.</i> - <i>2023-05-18</i></p>
40
  </div>
41
-
42
  <div id="summary">
43
  <button id="generate-summary">Generate Summary</button>
44
  <textarea id="output-summary" placeholder="Generated text will appear here..."></textarea>
45
  </div>
46
- </div>
47
-
48
  <div class="inner">
49
  <h2>Twitter Account Info (Live)</h2>
50
  <iframe src="/accounts" width=850 height="200" frameborder="0"></iframe>
51
  </div>
52
-
 
 
 
 
 
53
  <div id="outer">
54
  <h2>Twitter Account Analysis (Historical)</h2>
55
  <div class="inner">
56
 
57
- <p align="center"><iframe src="/examples1" width=850 height="450" frameborder="0"></iframe></p>
58
  </div>
59
  <div class="inner">
60
 
61
- <p align="center"><iframe src="/examples2" width=900 height="550" frameborder="0"></iframe></p>
62
  </div>
63
 
64
  </div>
@@ -66,6 +64,17 @@
66
 
67
 
68
  <script src="../static/main.js"></script>
 
 
 
69
 
 
 
 
 
 
 
 
70
 
 
71
  </html>
 
13
 
14
  <body>
15
  <div class="page">
16
+ <h1>My Twitter Sentiment API Webpage</h1>
17
  <div class="form">
18
  <label for="account">Choose the Twitter account you'd like to generate a response to your input:</label>
19
  <select name="account" id="account">
 
24
  <option value="cathiedwood">cathiedwood</option>
25
  <option value="ylecun">ylecun</option>
26
  </select>
 
27
  <textarea id="input" placeholder="Enter text here...">Hello world...!?</textarea>
28
+ <button id="generate">Generate</button> // onclick="generateTweets()"
29
  <textarea id="output" placeholder="Generated text will appear here..."></textarea>
30
  </div>
31
  <div id="form">
32
+ <div class="tweets">
33
+ <h2>Tweets (Live)</h2>
34
+ <iframe id="tweetsFrame" width="850" height="200" frameborder="0"></iframe>
 
 
 
 
35
  </div>
36
+
37
  <div id="summary">
38
  <button id="generate-summary">Generate Summary</button>
39
  <textarea id="output-summary" placeholder="Generated text will appear here..."></textarea>
40
  </div>
 
 
41
  <div class="inner">
42
  <h2>Twitter Account Info (Live)</h2>
43
  <iframe src="/accounts" width=850 height="200" frameborder="0"></iframe>
44
  </div>
45
+ </div>
46
+
47
+ <div class="inner">
48
+ <h2>Twitter Account Info (Live)</h2>
49
+ </div>
50
+
51
  <div id="outer">
52
  <h2>Twitter Account Analysis (Historical)</h2>
53
  <div class="inner">
54
 
55
+ <p align="center"><iframe src="/examples1" width=850 height="450" frameborder="0"></iframe></p>
56
  </div>
57
  <div class="inner">
58
 
59
+ <p align="center"><iframe src="/examples2" width=900 height="550" frameborder="0"></iframe></p>
60
  </div>
61
 
62
  </div>
 
64
 
65
 
66
  <script src="../static/main.js"></script>
67
+ <script>
68
+ window.onload = function () {
69
+ generateTweets(); // Call generateTweets() when the page finishes loading
70
 
71
+ };
72
+ function generateTweets() {
73
+ var account = document.getElementById("account").value;
74
+ console.log("What up")
75
+ var tweetsFrame = document.getElementById("tweetsFrame");
76
+ tweetsFrame.src = "/tweets/" + account;
77
+ console.log(tweetsFrame.src)
78
 
79
+ }</script>
80
  </html>