User1342 commited on
Commit
1566af8
β€’
1 Parent(s): 68ea3a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -25
app.py CHANGED
@@ -37,9 +37,9 @@ img {margin-bottom: -8px;}
37
  <!-- The App Section -->
38
  <div class="w3-padding-64 w3-white">
39
  <div class="w3-row-padding">
40
- <div class="w3-col l8 m6">
41
  <h1 class="w3-jumbo"><b>WatchTower 🐦🚧</b></h1>
42
- <h1 class="w3-xxxlarge w3-text-orange"><b>Block Unfavorable Tweets From Your Feed </b></h1>
43
  <p><span class="w3-xlarge">Scroll down to use WatchTower 1.0. ⬇ </span> WatchTower is a tool that identifies hate speech, misinformation, and extremist content and blocks it from your Twitter feed. WatchTower blocks content based on it's current database, so make sure to come back regullary to ensure you're up to date! WatchTower is simple to use: first scroll down the page and click the 'sign in with Twitter' button, then you'll be taken to the Twitter website and asked to verify yourself, after this you'll be taken back here, then simply scroll down to the botton of the page and click run!</p>
44
  <a href="https://www.watchtower.cartographer.one/"><button class="w3-button w3-light-grey w3-padding-large w3-section " onclick="document.getElementById('download').style.display='block'">
45
  <i class=""></i> Find Out More! πŸ’¬
@@ -89,24 +89,6 @@ function showDivs(n) {
89
  }
90
  </script>
91
  <br>
92
- <br>
93
- <br>
94
- <br>
95
- <br>
96
- <br>
97
- <br>
98
- <br>
99
- <br>
100
- <br>
101
- <br>
102
- <br>
103
- <br>
104
- <br>
105
- <br>
106
- <br>
107
-
108
-
109
-
110
  </body>
111
  </html>
112
 
@@ -120,7 +102,7 @@ import gradio as gr
120
  import tweepy
121
 
122
  # Setup the gradio block and add some generic CSS
123
- block = gr.Blocks(css="", title="WatchTower")
124
 
125
  # Chat history variable used for the chatbot prompt on the 'getting started' page.
126
  chat_history = []
@@ -135,7 +117,7 @@ def get_client_from_tokens(oauth_verifier, oauth_token):
135
  '''
136
  new_oauth1_user_handler = tweepy.OAuth1UserHandler(
137
  consumer_token, consumer_secret,
138
- callback="https://hf.space/embed/User1342/WatchTower/"
139
  )
140
  new_oauth1_user_handler.request_token = {
141
  "oauth_token": oauth_token,
@@ -347,7 +329,7 @@ def get_target_website():
347
  '''
348
  oauth1_user_handler = tweepy.OAuth1UserHandler(
349
  consumer_token, consumer_secret,
350
- callback="https://hf.space/embed/User1342/WatchTower/"
351
  )
352
  target_website = oauth1_user_handler.get_authorization_url(signin_with_twitter=True)
353
 
@@ -374,8 +356,6 @@ with block:
374
  gr.HTML(value=html_data)
375
  with gr.Group():
376
  with gr.Row().style(mobile_collapse=False, equal_height=True):
377
- gr.HTML(value=r'<img src="https://www.watchtower.cartographer.one/wp-content/uploads/2022/10/Blocking-Unfavorable-Content-1.png" alt="Markdown Monster icon" style="float: left; margin-right: 10px;" width="350"/>').style(
378
- )
379
  with gr.Box():
380
  #gr.Label(value="WatchTower", visible=True, interactive=False)
381
  url_params = gr.JSON({}, visible=False, label="URL Params").style(
 
37
  <!-- The App Section -->
38
  <div class="w3-padding-64 w3-white">
39
  <div class="w3-row-padding">
40
+ <div class="w3-col">
41
  <h1 class="w3-jumbo"><b>WatchTower 🐦🚧</b></h1>
42
+ <h1 class="w3-xxxlarge w3-text-blue"><b>Block Unfavorable Tweets From Your Feed </b></h1>
43
  <p><span class="w3-xlarge">Scroll down to use WatchTower 1.0. ⬇ </span> WatchTower is a tool that identifies hate speech, misinformation, and extremist content and blocks it from your Twitter feed. WatchTower blocks content based on it's current database, so make sure to come back regullary to ensure you're up to date! WatchTower is simple to use: first scroll down the page and click the 'sign in with Twitter' button, then you'll be taken to the Twitter website and asked to verify yourself, after this you'll be taken back here, then simply scroll down to the botton of the page and click run!</p>
44
  <a href="https://www.watchtower.cartographer.one/"><button class="w3-button w3-light-grey w3-padding-large w3-section " onclick="document.getElementById('download').style.display='block'">
45
  <i class=""></i> Find Out More! πŸ’¬
 
89
  }
90
  </script>
91
  <br>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  </body>
93
  </html>
94
 
 
102
  import tweepy
103
 
104
  # Setup the gradio block and add some generic CSS
105
+ block = gr.Blocks(css=".container { max-width: 800px; margin: auto; }", title="WatchTower")
106
 
107
  # Chat history variable used for the chatbot prompt on the 'getting started' page.
108
  chat_history = []
 
117
  '''
118
  new_oauth1_user_handler = tweepy.OAuth1UserHandler(
119
  consumer_token, consumer_secret,
120
+ callback="http://127.0.0.1:7860/'#https://hf.space/embed/User1342/WatchTower/"
121
  )
122
  new_oauth1_user_handler.request_token = {
123
  "oauth_token": oauth_token,
 
329
  '''
330
  oauth1_user_handler = tweepy.OAuth1UserHandler(
331
  consumer_token, consumer_secret,
332
+ callback="http://127.0.0.1:7860/"#"https://hf.space/embed/User1342/WatchTower/"
333
  )
334
  target_website = oauth1_user_handler.get_authorization_url(signin_with_twitter=True)
335
 
 
356
  gr.HTML(value=html_data)
357
  with gr.Group():
358
  with gr.Row().style(mobile_collapse=False, equal_height=True):
 
 
359
  with gr.Box():
360
  #gr.Label(value="WatchTower", visible=True, interactive=False)
361
  url_params = gr.JSON({}, visible=False, label="URL Params").style(