dhruvshettty commited on
Commit
3181725
1 Parent(s): 05cf3a9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +35 -13
index.html CHANGED
@@ -7,18 +7,40 @@
7
  <link rel="stylesheet" href="style.css" />
8
  </head>
9
  <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>
13
- You can modify this app directly by editing <i>index.html</i> in the
14
- Files and versions tab.
15
- </p>
16
- <p>
17
- Also don't forget to check the
18
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank"
19
- >Spaces documentation</a
20
- >.
21
- </p>
22
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </body>
24
  </html>
 
7
  <link rel="stylesheet" href="style.css" />
8
  </head>
9
  <body>
10
+ <header>
11
+ <h1>Stance Prediction on Latest News</h1>
12
+ </header>
13
+ <nav>
14
+ <ul>
15
+ <li><a href="https://modal.com/apps/dhruvshettty/biweekly_pipeline">Modal Biweekly Pipeline</a></li>
16
+ <li><a href="https://modal.com/apps/dhruvshettty/daily_pipeline">Modal Daily Pipeline</a></li>
17
+ <li><a href="https://modal.com/apps/dhruvshettty/latest_news_webhook">Modal Articles Webhook</a></li>
18
+ </ul>
19
+ </nav>
20
+ <section id="main-content">
21
+ <button id="get-articles" type="button">Get recent articles...</button>
22
+ </section>
23
+
24
+ <script
25
+ const endpoint = 'https://dhruvshettty--latest-news-webhook-response-articles.modal.run/';
26
+
27
+ document.getElementById("get-articles").onclick = function() {
28
+ fetch(endpoint)
29
+ .then(response => response.json())
30
+ .then(data => {
31
+ const mainContent = document.getElementById("main-content");
32
+ data.forEach(post => {
33
+ const article = document.createElement('article');
34
+ article.innerHTML = `
35
+ <h2>${post.title}</h2>
36
+ <p>Published on ${post.publishedat}</p>
37
+ <p>Categories: ${post.predicted_topic}</p>
38
+ <p>Stance: ${post.predicted_stance}</p>
39
+ `;
40
+ mainContent.appendChild(article);
41
+ })
42
+ .catch(error => console.error(error));
43
+ }
44
+ </script>
45
  </body>
46
  </html>