WhatPulse Forums » Support » Client software v » New Eggdrop-TCL Script please!!!! Welcome back, Guest.

Post Reply 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Eggdrop-TCL Script please!!!!
10-28-2009, 06:05 PM
Post: #8
New Eggdrop-TCL Script please!!!!
I use my own Script for getting Data from whatpulse.
package require http
bind pub - ?whatpulse L:whatpulse
proc L:whatpulse {nick host hand chan arg} {
    set connection [http::config -useragent "Mozilla 4.0"]
    catch {set connection [http::geturl XXXX://whatpulse.org/stats/users/[lindex $arg 0]/ -timeout 3000]} error
    set wpdata [http::data $connection]
    http::cleanup $connection

    regexp {(?i)has been a participant since(.*?)users to WhatPulse.} $wpdata -> wp(readout)
    regexp {(?i)This user is in team(.*?)in that team.} $wpdata -> wp(readteam)
    if {[info exists wp(readteam)]} { regexp {(?i)target="_blank" rel="nofollow">(.*?)</a>} $wp(readteam) -> wp(team); set wp(teamrank) [lindex $wp(readteam) 7] }

## Design Variables for Channel-Output
    set wp(nick)             [lindex $arg 0]
    set wp(keys)             [lindex $wp(readout) 10]
    set wp(clicks)         [lindex $wp(readout) 13]
    set wp(mouse_miles)         [lindex $wp(readout) 22]
    set wp(keys_per_sec)     [lindex $wp(readout) 25]
    set wp(clicks_per_sec)     [lindex $wp(readout) 28]
    set wp(lastpulse_date)     [lindex $wp(readout) 42]
    set wp(lastpulse_time)     [lindex $wp(readout) 43]
    set wp(number_of_pulses)     [lindex $wp(readout) 50]
    set wp(country)         [lindex $wp(readout) 56]
    set wp(refered_users)     [lindex $wp(readout) 60]
    # $wp(team)         -> ->    contains the teamname - if user is in an team
    # $wp(teamrank)     -> ->    contains the rank in team - if user is in an team

## Bugfixing
    if {$wp(country) == "United"} { $wp(country) == "United States" }

## Channel-Output
    putserv "privmsg $chan :«Whatpulse» $wp(nick) ($wp(country)) hat $wp(keys) gezählte Tastenanschläge und $wp(clicks) Mausklicks. (Last Pulse: $wp(lastpulse_date) um $wp(lastpulse_time) Uhr)"
    if {[info exists wp(team)]} {
        ##INFO## this line will only be executed if the user is in an team.
        putserv "privmsg $chan :«Whatpulse» $wp(nick) ist im Team $wp(team) und hat dort den Rang: $wp(teamrank)"
putlog "Whatpulse-Script by LuZ1 loaded"

the only thing you have to do is change the XXXX in line 5 of this script to http (board restrictions for urls ^^)

is dont use the given api for getting information, because i dont want to search an userid - i want to search an nickname
currently the script is in german - but its easy to translate - just use the vars and layout it yourself.

see it work:
Quote:«18:53:55» <@LuZ1F3R> ?whatpulse LuZ1F3R
«18:53:56» <@Zwergnase> «Whatpulse» LuZ1F3R (Germany.) hat 13,712,854 gezählte Tastenanschläge und 4,946,254 Mausklicks. (Last Pulse: 2009-10-28 um 17:04:33 Uhr)
«18:53:57» <@Zwergnase> «Whatpulse» LuZ1F3R ist im Team #t2f-palace und hat dort den Rang: 2nd
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
New Eggdrop-TCL Script please!!!! - X-Kal - 02-03-2009, 06:09 PM
New Eggdrop-TCL Script please!!!! - LuZ1F3R - 10-28-2009 06:05 PM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [SOLVED] .sh permissions script fatsa 4 3,098 08-04-2015 12:02 AM
Last Post: LukeLR
  script to check if running or not Sc0rian 0 2,722 07-09-2013 02:00 PM
Last Post: Sc0rian
  Change to setup script austinmarton 3 2,520 04-08-2011 04:53 PM
Last Post: hostname
  mIRC 7.1 and mIRC script Tzan 6 8,010 09-11-2010 04:47 PM
Last Post: Tzan

Forum Jump:

User(s) browsing this thread: 1 Guest(s)