User Control Panel
Advertisements

HELP US, HELP YOU!

Leviathan: WhatPulse

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sun Jan 02, 2005 2:29 pm    Post subject: Reply with quote

Usage: !whatpulse

Example:
Quote:
Kirsle: !whatpulse kirsle
CodyCKS: :: WhatPulse Profile ::

Username: Kirsle (ID: 3412)
Country: United States
Date Joined: 2003-12-16
Homepage: http://www.kirsle.net/

Last Pulse: 2004-12-09 22:18:08
Total Pulses: 1
Total Key Count: 11,156,655
Av. Keys per Pulse: 11,156,655
Total Click Count: 960,316
Av. Clicks per Pulse: 960,316

Average Keys per Second: 0.36
Average Clicks per Second: 0.03
Overall Rank: 143rd

Team Name: Bot-Depot (ID: 323)
Members: 11
Team Keys: 27,658,221
Team Clicks: 4,461,924
Description: Team Bot-Depot is a team of Bot developers
Date Formed: 06 January 2004 at 06:22:54
Rank in Team: 1st

WhatPulse ~ http://www.whatpulse.org/


Code:
#      .   .               <Leviathan><br />#     .:...::     Command Name // !whatpulse<br />#    .::   ::.     Description // Get a WhatPulse user's profile.<br /># ..:;;. ' .;;:..        Usage // !whatpulse <username><br />#    .  '''  .     Permissions // Public<br />#     :;,:,;:         Listener // All<br />#     :     :        Copyright // 2005 AiChaos Inc.<br /><br />sub whatpulse {<br />     my ($self,$client,$msg) = @_;<br /><br />     # A username must be supplied.<br />     if (length $msg > 0) {<br />          my $wp = LWP::Simple::get "http://whatpulse.org/api/user.php?account=$msg";<br /><br />          # Source must be defined and user must exist.<br />          if (length $wp == 0) {<br />               return "The WhatPulse API could not be contacted!";<br />          }<br />          if ($wp =~ /Invalid AccountName/i) {<br />               return "That user does not have a WhatPulse profile.";<br />          }<br /><br />          # Array of lines.<br />          my @lines = split(/\n/, $wp);<br /><br />          # Shift off the first line (contains User ID).<br />          my %pulse = (<br />               'UserID' => shift(@lines),<br />          );<br />          $pulse{'UserID'} =~ s/\# showing basic information about userid (.*?)/$1/ig;<br />          $pulse{'UserID'} =~ s/\s//g;<br /><br />          # Go through the lines.<br />          foreach my $line (@lines) {<br />               next if length $line == 0;<br />               last if $line =~ /^X END/i;<br /><br />               # Split the line up.<br />               my ($void,$var,$value) = split(/\s+/, $line, 3);<br />               $value =~ s/\s+$//ig;<br /><br />               # Save it to the hash.<br />               $pulse{$var} = $value;<br />          }<br /><br />          # Return the response.<br />          my $reply = ":: WhatPulse Profile ::\n\n"<br />               . "Username: $pulse{'AccountName'} (ID: $pulse{'UserID'})\n"<br />               . "Country: $pulse{'Country'}\n"<br />               . "Date Joined: $pulse{'DateJoined'}\n"<br />               . "Homepage: $pulse{'Homepage'}\n\n"<br />               . "Last Pulse: $pulse{'LastPulse'}\n"<br />               . "Total Pulses: $pulse{'Pulses'}\n"<br />               . "Total Key Count: $pulse{'TotalKeyCount'}\n"<br />               . "Av. Keys per Pulse: $pulse{'AvKeysPerPulse'}\n"<br />               . "Total Click Count: $pulse{'TotalMouseClicks'}\n"<br />               . "Av. Clicks per Pulse: $pulse{'AvClicksPerPulse'}\n\n"<br />               . "Average Keys per Second: $pulse{'AvKPS'}\n"<br />               . "Average Clicks per Second: $pulse{'AvCPS'}\n"<br />               . "Overall Rank: $pulse{'Rank'}";<br /><br />          # If in a team...<br />          if (length $pulse{'TeamID'} > 0) {<br />               $reply .= "\n\n"<br />                    . "Team Name: $pulse{'TeamName'} (ID: $pulse{'TeamID'})\n"<br />                    . "Members: $pulse{'TeamMembers'}\n"<br />                    . "Team Keys: $pulse{'TeamKeys'}\n"<br />                    . "Team Clicks: $pulse{'TeamClicks'}\n"<br />                    . "Description: $pulse{'TeamDescription'}\n"<br />                    . "Date Formed: $pulse{'TeamDateFormed'}\n"<br />                    . "Rank in Team: $pulse{'RankInTeam'}";<br />          }<br /><br />          # Link to WhatPulse.org<br />          $reply .= "\n\n"<br />               . "WhatPulse ~ http://www.whatpulse.org/";<br /><br />          # Return.<br />          return $reply;<br />     }<br />     else {<br />          return "You must provide a username when calling this command, i.e.\n\n"<br />               . "!whatpulse kirsle";<br />     }<br />}<br />{<br />     Category => 'Utilities',<br />     Description => 'Get a WhatPulse user\'s profile.',<br />     Usage => '!whatpulse <username>',<br />     Listener => 'All',<br />};

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group