wilmerags commited on
Commit
25a6734
·
1 Parent(s): fac189d

test: Add initial tweepy code for Twitter API interaction

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,9 +1,18 @@
1
  import streamlit as st
2
-
 
 
 
 
3
  st.title("Tweet-SNEst")
4
  st.write("Visualize tweets embeddings in 2D using colors for topics labels.")
5
  col1, col2 = st.columns(2)
6
  with col1:
7
  tw_user = st.text_input("Twitter handle", "huggingface")
8
  with col2:
9
- sample = st.number_input("Maximum number of tweets to use", 1, 300, 100)
 
 
 
 
 
 
1
  import streamlit as st
2
+ import tweepy
3
+
4
+
5
+ client = tweepy.Client(bearer_token=st.secrets["tw_bearer_token"])
6
+
7
  st.title("Tweet-SNEst")
8
  st.write("Visualize tweets embeddings in 2D using colors for topics labels.")
9
  col1, col2 = st.columns(2)
10
  with col1:
11
  tw_user = st.text_input("Twitter handle", "huggingface")
12
  with col2:
13
+ sample = st.number_input("Maximum number of tweets to use", 1, 300, 100)
14
+
15
+ usr = client.get_user(username=tw_user)
16
+
17
+ st.write(usr.data.id)
18
+