Spaces:
Runtime error
Runtime error
Merge branch 'main' of https://huggingface.co/spaces/CognitiveLabs/GPT-auto-webscraping
Browse files- README.md +1 -1
- analytics/gs.py +18 -0
- app.py +5 -0
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
title: GPT Auto Webscraping
|
| 3 |
emoji: 🍧
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: purple
|
| 6 |
sdk: streamlit
|
| 7 |
sdk_version: 1.21.0
|
|
|
|
| 1 |
---
|
| 2 |
title: GPT Auto Webscraping
|
| 3 |
emoji: 🍧
|
| 4 |
+
colorFrom: gray
|
| 5 |
colorTo: purple
|
| 6 |
sdk: streamlit
|
| 7 |
sdk_version: 1.21.0
|
analytics/gs.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
|
| 4 |
+
def ga_markdown():
|
| 5 |
+
# Add Google Analytics code to the header
|
| 6 |
+
html_string = """
|
| 7 |
+
<!-- Global site tag (gtag.js) - Google Analytics -->
|
| 8 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RGME574XZF"></script>
|
| 9 |
+
<script>
|
| 10 |
+
window.dataLayer = window.dataLayer || [];
|
| 11 |
+
function gtag(){dataLayer.push(arguments);}
|
| 12 |
+
gtag('js', new Date());
|
| 13 |
+
gtag('config', 'G-RGME574XZF');
|
| 14 |
+
console.log('gtag')
|
| 15 |
+
</script>
|
| 16 |
+
"""
|
| 17 |
+
components.html(html_string)
|
| 18 |
+
st.markdown(html_string, unsafe_allow_html=True)
|
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from AssistantService import GPTAssistant
|
| 2 |
from openai.error import AuthenticationError
|
| 3 |
import streamlit as st
|
|
|
|
| 4 |
import configparser
|
| 5 |
|
| 6 |
config = configparser.ConfigParser()
|
|
@@ -59,3 +60,7 @@ if 'code_generated' in st.session_state:
|
|
| 59 |
st.table(result)
|
| 60 |
else:
|
| 61 |
st.write("error extracting data")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from AssistantService import GPTAssistant
|
| 2 |
from openai.error import AuthenticationError
|
| 3 |
import streamlit as st
|
| 4 |
+
import analytics.gs as ga_tag
|
| 5 |
import configparser
|
| 6 |
|
| 7 |
config = configparser.ConfigParser()
|
|
|
|
| 60 |
st.table(result)
|
| 61 |
else:
|
| 62 |
st.write("error extracting data")
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
ga_tag.ga_markdown()
|
| 66 |
+
|