Skip to content

Commit

Permalink
Merge pull request #44 from appatalks/appatalks_eva_playground
Browse files Browse the repository at this point in the history
Adding Gemini, file structure
  • Loading branch information
appatalks authored Mar 9, 2024
2 parents 1eb4080 + fc9c729 commit 220b459
Show file tree
Hide file tree
Showing 24 changed files with 348 additions and 26 deletions.
112 changes: 112 additions & 0 deletions 1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<title>Chat Interface</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}

.chat-container {
width: 400px;
margin: 0 auto;
background-color: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.message {
margin-bottom: 10px;
display: flex;
}

.message .bubble {
max-width: 70%;
padding: 10px 15px;
border-radius: 20px;
}

.message .user-bubble {
background-color: #4e8cff;
color: #fff;
margin-left: auto;
}

.message .assistant-bubble {
background-color: #f2f2f2;
color: #333;
margin-right: auto;
}

.input-container {
margin-top: 20px;
display: flex;
}

.input-container input {
flex: 1;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc;
font-size: 14px;
}

.input-container button {
padding: 10px 15px;
background-color: #4e8cff;
color: #fff;
border: none;
border-radius: 4px;
margin-left: 10px;
font-size: 14px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="chat-container">
<div class="message">
<div class="bubble user-bubble">
Hey, how can I help you?
</div>
</div>
<div class="message">
<div class="bubble assistant-bubble">
I'm an AI assistant. How can I assist you today?
</div>
</div>
<!-- Add more messages here -->

<div class="input-container">
<input type="text" id="message-input" placeholder="Type your message">
<button onclick="sendMessage()">Send</button>
</div>
</div>

<script>
function sendMessage() {
var input = document.getElementById("message-input");
var message = input.value;
input.value = "";

var messageContainer = document.createElement("div");
messageContainer.className = "message";

var bubble = document.createElement("div");
bubble.className = "bubble user-bubble";
bubble.innerHTML = message;

messageContainer.appendChild(bubble);

var chatContainer = document.getElementsByClassName("chat-container")[0];
chatContainer.appendChild(messageContainer);

// Scroll to the bottom of the chat container
chatContainer.scrollTop = chatContainer.scrollHeight;
}
</script>
</body>
</html>

1 change: 1 addition & 0 deletions core/external/date.data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Today's date: Saturday, May 20th, 2023
15 changes: 15 additions & 0 deletions core/external/external.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Today's date: Sunday, March 26th, 2023
Weather for San Antonio, Texas: Overcast 64°F
The SPY ticker price is: 395.75
Top 5 news headlines:
New tornadoes menace Georgia as Biden approves disaster relief for Mississippi - ABC News
Russia plans to station tactical nuclear weapons in Belarus, Putin says - CNN
Trump treats himself after first 2024 rally speech in Waco – with McDonald’s - The Independent
Biden's FAA nominee bows out, after senators waver - POLITICO
12 injured in floor collapse at off-campus apartment party near Indiana University of Pennsylvania - CNN
Top 5 market headlines:
Intel co-founder Gordon Moore dies at 94.
Iovance Biotherapeutics completes license application submission for advanced melanoma therapy; shares rally.
McMahon agreed to reimburse WWE for investigation into misconduct allegations.
Softbank to merge with AI robotics company in which it had invested.
Rivian relocates engineers to Illinois factory, California HQ to increase production speedreport.
11 changes: 6 additions & 5 deletions externaldata.sh → core/external/externaldata.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Set File Path
filepath=/var/www/html
filepath=/usr/share/nginx/html/core/external/

# Get today's date
today=$(date +"%A, %B %dth, %Y")
Expand All @@ -24,6 +24,7 @@ dow_price=$(curl -s "https://query1.finance.yahoo.com/v8/finance/chart/DOW?inter
qyld_price=$(curl -s "https://query1.finance.yahoo.com/v8/finance/chart/QYLD?interval=1d" | jq -r '.chart.result[0].meta | "Price: \(.regularMarketPrice) Change: " + (100 * (.regularMarketPrice - .chartPreviousClose) / .chartPreviousClose | tostring | split(".") | .[0] + "." + .[1][:3]) + "%"')
ryld_price=$(curl -s "https://query1.finance.yahoo.com/v8/finance/chart/RYLD?interval=1d" | jq -r '.chart.result[0].meta | "Price: \(.regularMarketPrice) Change: " + (100 * (.regularMarketPrice - .chartPreviousClose) / .chartPreviousClose | tostring | split(".") | .[0] + "." + .[1][:3]) + "%"')


# Marketpulse by Marketwatch.com
marketpulse=$(curl -s "http://feeds.marketwatch.com/marketwatch/marketpulse/" | xmlstarlet sel -t -m "//item[position()<=5]" -v "title" -o $'\n' | sed 's/: *//g; s/$/./g')

Expand All @@ -34,14 +35,14 @@ spaceweather=$(curl -s https://services.swpc.noaa.gov/products/alerts.json | jq
# Write the data to external.data file
#
#
echo "Today's date: $today " > $filepath/date.data
echo "Today's date: $today" > $filepath/date.data

echo "Weather for San Antonio, Texas: $weather " > $filepath/weather.data
echo "Weather for San Antonio, Texas: $weather" > $filepath/weather.data

echo "Top 5 news headlines: " > $filepath/news.data
echo "Top 5 news headlines are: " > $filepath/news.data
echo "$news " >> $filepath/news.data

echo "Top 5 market headlines: " > $filepath/market.data
echo "Top 5 market headlines are: " > $filepath/market.data
echo "$marketpulse " >> $filepath/market.data
echo "SPY ticker $spy_price " >> $filepath/market.data
echo "GOLD ticker $gold_price " >> $filepath/market.data
Expand Down
12 changes: 12 additions & 0 deletions core/external/headlines.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Top 5 news headlines:
Covenant School shooter was under care for emotional disorder and hid guns at home, police say - CNN
Pence Must Testify to Jan. 6 Grand Jury, Judge Rules - The New York Times
At least 39 die in migrant center fire by U.S.-Mexico border - Los Angeles Times
Vice President Harris wiped away tears as she toured Ghana's Cape Coast slave castle - NPR
'Serial' murder case: Adnan Syed's conviction is reinstated - NBC News
Top 5 news headlines:
Covenant School shooter was under care for emotional disorder and hid guns at home, police say - CNN
Pence Must Testify to Jan. 6 Grand Jury, Judge Rules - The New York Times
At least 39 die in migrant center fire by U.S.-Mexico border - Los Angeles Times
Vice President Harris wiped away tears as she toured Ghana's Cape Coast slave castle - NPR
'Serial' murder case: Adnan Syed's conviction is reinstated - NBC News
16 changes: 16 additions & 0 deletions core/external/market.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Top 5 market headlines are:
American, JetBlue alliance blocked by judge.
U.S. stocks end lower, but Nasdaq posts longest weekly win streak since February.
Oil prices mark first weekly gain in 5 weeks; natural-gas futures end the week 14% higher.
Krystal Biotech stock rises after FDA approves treatment for rare skin disease.
Gold futures log biggest weekly loss in over 3 months.
SPY ticker Price: 418.62 Change: -0.145%
GOLD ticker Price: 17.86 Change: 0.280%
HMY ticker Price: 4.82 Change: -0.207%
WEAT ticker Price: 6.14 Change: -0.486%
ONL ticker Price: 5.9 Change: 0.340%
VET ticker Price: 12.05 Change: 1.687%
MMM ticker Price: 99.03 Change: -0.612%
DOW ticker Price: 51.95 Change: 0.154%
QYLD ticker Price: 17.57 Change: -0.340%
RYLD ticker Price: 18.09 Change: -1.255%
6 changes: 6 additions & 0 deletions core/external/news.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Top 5 news headlines are:
Ukraine's Zelenskyy arrives in Hiroshima for G7 summit as world leaders sanction Russia - The Associated Press
Russia’s Wagner group claims to have captured Bakhmut but Ukraine says it still controls a part of it - CNN
Nebraska lawmakers pass 12-week abortion ban, restrictions on gender-affirmin - NPR
Republicans and Democrats don't like debt ceiling negotiations - The Washington Post
Russia warns West sending F-16s to Ukraine ‘carries enormous risks’: TASS - POLITICO Europe
40 changes: 40 additions & 0 deletions core/external/solar.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Current Space Weather Reprot: XM5S,2023-05-20 15:21:47.263,Space Weather Message Code: SUMXM5
Serial Number: 186
Issue Time: 2023 May 20 1521 UTC

SUMMARY: X-ray Event exceeded M5
Begin Time: 2023 May 20 1454 UTC
Maximum Time: 2023 May 20 1500 UTC
End Time: 2023 May 20 1504 UTC
X-ray Class: M5.6
Location: N18E53
NOAA Scale: R2 - Moderate

NOAA Space Weather Scale descriptions can be found at
www.swpc.noaa.gov/noaa-scales-explanation

Potential Impacts: Area of impact centered primarily on sub-solar point on the sunlit side of Earth.
Radio - Limited blackout of HF (high frequency) radio communication for tens of minutes.
XM5A,2023-05-20 15:01:40.500,Space Weather Message Code: ALTXMF
Serial Number: 315
Issue Time: 2023 May 20 1501 UTC

ALERT: X-Ray Flux exceeded M5
Threshold Reached: 2023 May 20 1456 UTC
NOAA Scale: R2 - Moderate

NOAA Space Weather Scale descriptions can be found at
www.swpc.noaa.gov/noaa-scales-explanation

Potential Impacts: Area of impact centered on sub-solar point on the sunlit side of Earth. Extent of blackout of HF (high frequency) radio communication dependent upon current X-ray Flux intensity. For real-time information on affected area and expected duration please see http://www.swpc.noaa.gov/products/d-region-absorption-predictions-d-rap.
XM5S,2023-05-20 13:00:17.373,Space Weather Message Code: SUMXM5
Serial Number: 185
Issue Time: 2023 May 20 1300 UTC

SUMMARY: X-ray Event exceeded M5
Begin Time: 2023 May 20 1225 UTC
Maximum Time: 2023 May 20 1235 UTC
End Time: 2023 May 20 1240 UTC
X-ray Class: M8.9
Location: N18E54
NOAA Scale: R2 - Moderate
Expand Down
2 changes: 2 additions & 0 deletions core/external/spy.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The SPY ticker price is: 395.6
The SPY ticker price is: 395.6
1 change: 1 addition & 0 deletions core/external/weather.data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Weather for San Antonio, Texas: Partly cloudy +23°C
File renamed without changes
File renamed without changes
Empty file added core/img/favicon.ico
Empty file.
File renamed without changes
File renamed without changes
Binary file added core/img/thumb-125.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions external.js → core/js/external.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Inital External Data Discovery

// Current Date
const dateFile = "date.data"; // relative path to the file
const dateFile = "core/external/date.data"; // relative path to the file
let dateContents; // create a variable to store the file contents
fetch(dateFile)
.then(response => response.text())
Expand All @@ -10,7 +10,7 @@ fetch(dateFile)
})

// Weather Report
const weatherFile = "weather.data";
const weatherFile = "core/external/weather.data";
let weatherContents;
fetch(weatherFile)
.then(response => response.text())
Expand All @@ -19,7 +19,7 @@ let weatherContents;
})

// Top Headline News
const newsFile = "news.data";
const newsFile = "core/external/news.data";
let newsContents;
fetch(newsFile)
.then(response => response.text())
Expand All @@ -28,7 +28,7 @@ let newsContents;
})

// Top Market Headlines
const marketFile = "market.data";
const marketFile = "core/external/market.data";
let marketContents;
fetch(marketFile)
.then(response => response.text())
Expand All @@ -37,7 +37,7 @@ let marketContents;
})

// Latest Solar Weather
const solarFile = "solar.data";
const solarFile = "core/external/solar.data";
let solarContents;
fetch(solarFile)
.then(response => response.text())
Expand Down
Loading

0 comments on commit 220b459

Please sign in to comment.