-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add all default plugins to core repository and remove the plugin down…
…loading from the scripts
- Loading branch information
Showing
11 changed files
with
97 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const fs = require("fs"); | ||
const events = []; | ||
|
||
const addEvent = (event, date) => { | ||
events.push({event, date}); | ||
fs.writeFileSync("events.json", JSON.stringify(events)); | ||
console.log("Event added: " + event); | ||
}; | ||
|
||
const checkEvents = () => { | ||
setInterval(() => { | ||
const now = new Date(); | ||
events.forEach((event) => { | ||
const eventDate = new Date(event.date); | ||
if (now.getTime() >= eventDate.getTime()) { | ||
console.log("Reminder: " + event.event); | ||
akulAI.speak("Reminder: " + event.event); | ||
} | ||
}); | ||
}, 60000); | ||
}; | ||
|
||
module.exports = { | ||
addEvent, | ||
checkEvents | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
author: Akul Goel | ||
dependencies: fs | ||
description: This plugin asks for events and stores them in a JSON database. When the time comes, it will remind you to do your saved event. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/perl | ||
|
||
use LWP::UserAgent; | ||
|
||
sub fetch_stock_price { | ||
my $ticker = shift; | ||
|
||
# Get stock information from Google Finance | ||
my $url = "https://www.google.com/finance?q=$ticker"; | ||
my $ua = LWP::UserAgent->new; | ||
my $response = $ua->get($url); | ||
|
||
# Check if request was successful | ||
if ($response->is_success) { | ||
my $html = $response->decoded_content; | ||
|
||
# Extract the stock price | ||
if ($html =~ /ref_.*_l">(.*?)<\/span>/i) { | ||
return "The current stock price for $ticker is $1."; | ||
} else { | ||
return "Unable to find stock price for $ticker."; | ||
} | ||
} else { | ||
return "Error fetching stock price for $ticker: " . $response->status_line; | ||
} | ||
} | ||
|
||
sub handle { | ||
my $command = shift; | ||
if ($command =~ /stock price for (.*)/i) { | ||
return fetch_stock_price($1); | ||
} | ||
return "Invalid command."; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
author: Akul Goel | ||
dependencies: LWP::UserAgent | ||
description: This plugin tells you the stock prices when you ask it to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import datetime | ||
|
||
# define all commonly used variables here | ||
now = datetime.datetime.now() | ||
|
||
def handle(command): | ||
if "time" in command: | ||
time_now = now.strftime("%H:%M:%S") | ||
akulai.speak(f"The current time is{time_now}") | ||
if "date" in command: | ||
date_now = now.strftime("%Y-%m-%d") | ||
akulai.speak(f"The current date is{date_now}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
author: Akul Goel | ||
dependencies: datetime | ||
description: This plugin tells you the time/date when you ask it to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
use Weather::Google; | ||
|
||
my $location = shift; | ||
|
||
my $weather = Weather::Google->new($location); | ||
|
||
print "The weather in $location is currently " . $weather->condition->temp . "F and " . $weather->condition->text . "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
author: Akul Goel | ||
dependencies: Weather::Google | ||
description: This plugin checks Google for the weather around you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters