File: myuptime.rb

package info (click to toggle)
weechat-scripts 20071011
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 400 kB
  • ctags: 377
  • sloc: python: 3,470; perl: 1,305; ruby: 270; makefile: 37
file content (20 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ==================================================================================================
#  myuptime.rb (c) April 2006 by David DEMONCHY (fusco) <fusco.spv@gmail.com>
#
#  Licence     : GPL v2
#  Description : Print machine uptime in the current canal
#  Syntax      : /myuptime
#    => <nick> uptime  <hostname> :  00:16:58 up 11:09,  4 users,  load average: 0.05, 0.21, 0.29 
#
# ==================================================================================================

def weechat_init
    Weechat.register("myuptime", "0.1", "", "Script ruby WeeChat for display my uptime")
    Weechat.add_command_handler("myuptime", "myuptime")
    return Weechat::PLUGIN_RC_OK
end

def myuptime(server, args)
Weechat.command("/me uptime "+ `hostname`.chomp + ":"  + `uptime`.chomp)
return Weechat::PLUGIN_RC_OK
end