-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript1.ini
More file actions
32 lines (32 loc) · 956 Bytes
/
script1.ini
File metadata and controls
32 lines (32 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[script]
n0=alias weather {
n1= ; Set the channel to display the weather info
n2= var %channel = #ken
n3= ; Join the channel
n4= join %channel
n5=
n6= ; Send a HTTP GET request to weather.com
n7= http -s -i -t 5 get http://weather.com/weather/today/l/$location/USFL0234:1:1
n8=
n9= ; Check if the HTTP request was successful
n10= if ($httperror) {
n11= echo -a Error: Unable to get weather data ($httperror)
n12= return
n13= }
n14=
n15= ; Parse the HTML response and extract the weather data
n16= parse $httpfile(1) for /weather-data/ {
n17= ; Send formatted weather info to the IRC channel
n18= echo -a Weather data: $weather_data | channel %channel
n19= }
n20=
n21= ; If no data is found, display an error message
n22= if ($httpfile(1) == "") {
n23= echo -a Error: Unable to parse weather data
n24= }
n25=}
n26=
n27=on *:text:*weather:*: {
n28= ; Run the weather command
n29= weather
n30=}