undertow
Group: Members
Posts: 48
Joined: Mar. 2005 |
|
Posted: Mar. 06 2005,08:42 |
|
So here's a little Xchat plug i couldnt help but make. It requires that you have imagemagick and lynx both installed to use it, and is kind of a mess since Im fairly new to scripting and Xchat. Im sure someone could take the idea and spin it into a nice, clean perl plugin for xchat (and not the bash script that it is) with a little more knowledge than i have. any how: The jist: type /snapshot in a channel, and it takes a full screenshot, saves it to /opt/monkey/htdocs, starts the server, gets your IP from whatismyip.com, posts it to the channel. Then, it waits 5 minutes and shuts the server down. Youll need to edit /opt/monkey/htdocs/index.html to contain a link to the .jpg of course. Here's /usr/bin/snapshot: (remember to chmod x it if you copy) ---start---
#!/bin/bash sudo /opt/imagemagick/bin/import -w root /opt/monkey/htdocs/myscreen.jpg sudo chmod a+rx /opt/monkey/htdocs/myscreen.jpg sudo /opt/monkey/bin/banana start > /dev/null
echo " ---Screenshot"
sleep 5m
sudo killall -9 monkey
echo "Screenshot Server Killed."
----end-----
Youll need to open up Xchat, and under Settings > User Commands... add a new command, like so:
SNAPSHOT /exec -o snapshot & lynx -source whatismyip.com | perl -ne '/Your ip is ([\d.]+) / and print($1), exit'
thanks to a friend, Katie, for the perl part!
|