Remote API phpDenora
——————–
Ce fichier contient un peu de documentation concernant la possibilité d’intégrer
quelques valeurs de stats et graphiques dans des sites web externes.
——————————.
1) Obtenir des données en utilisant remote.php |
——————————´
Ce fichier doit être appeler de cette facon:
(phpdenora-url)/remote.php?func=(function-name)¶m=(parameter)
 Donc par exemple:
Â
http://stats.irc-attitude.net/remote.php?func=numinchan¶m=%23denora
Veuillez noter: %23 remplace # et est requis quand vous spécifiez un salon dans un URL.
Pour d’autre préfixe de salon, veuillez utiliser les équivalents HTML.
1.1 Liste des fonctions disponibles:
———————————–
- ‘currentstats’
Retourne les valeurs suivantes, une par ligne:
‘current users’, ‘time’, ‘current channels’, ‘time’, ‘current opers’, ‘time’,
‘current servers’, ‘time’, ‘daily users’, ‘time’
Usage: remote.php?func=currentstats
- ‘maxstats’
Retourne les paires de valeur suivante, une par ligne:
‘max users’ ‘time’, ‘max channels’ ‘time’, ‘max opers’ ‘time’, ‘max servers’ ‘time’
Usage: remote.php?func=maxstats
- ‘topusers’
Retourne une liste d’usagers, les ‘n’ plus actif , un par ligne.
Usage: remote.php?func=topusers¶m=n (where ‘n’ is a number)
- ‘topchans’
Retourne une liste de salons, les ‘n’ plus actifs, un par ligne.
Usage: remote.php?func=topchans¶m=n (where ‘n’ is a number)
- ‘serverlist’
Retourne la liste des serveurs dans la banque de donnée, un par ligne.
Usage: remote.php?func=serverlist
- ‘chanlist’
Returns a list of the current channels on the network.
Each line contains 3 tab-separated values: ‘channel’, ‘users’, ‘topic’
Usage: remote.php?func=chanlist¶m=n (where ‘n’ is the minimum amount of users)
- ‘userlist’
Returns a list of the users currently present in the specified channel, followed by
their channel status, if set
Usage: remote.php?func=userlist¶m=%23mychannel
- ‘numinchan’
Returns the current number of users in the given channel
Usage: remote.php?func=numinchan¶m=%23mychannel
- ‘chanpeak’
Returns the peak user count of the given channel
Usage: remote.php?func=chanpeak¶m=%23mychannel
- ‘chantopic’
Returns the following values, one per line:
‘channel topic’, ‘topic author’, ‘topic time’
Usage: remote.php?func=chantopic¶m=%23mychannel
- ‘operlist’
Returns a list of the operators online, one per line:
Usage: remote.php?func=operlist
- ‘seenuser’
Returns a detailed list of users (online and offline) matching the parameter
Each line contains these tab-separated values: ‘nick’, ‘realname’, ‘username’,
‘hostname’, ‘online’, ‘away’, ‘connecttime’, ‘lastquit’, ‘uline’
Usage: remote.php&func=seenuser¶m=user
1.2 How to process the data you got
———————————–
- For PHP users:
You may want to have a look at the docs/phpdenora.php file for some examples
and useful functions
- For JavaScript users:
Sorry, no documentation / examples yet
——————————–.
2) Showing graphs on your web site |
——————————–´
The graphs need to be integrated as if they were a normal image:
So for example:
2.1 Pie graphs (piegraphs.php)
————–
Needed parameters:
mode: ‘country’ for tld stats or ‘version’ for client stats
chan: ‘channel-name’ for channel stats or ‘global’ for network global stats
Example:
piegraphs.php?mode=country&chan=%23denora
2.2 Bar graphs (bargraphs.php)
————–
Needed parameters:
mode: ‘chan’ for channel stats or ‘user’ for user stats
chan: ‘channel-name’ for channel stats or ‘global’ for network global stats
type: ’0′ for total, ’3′ for monthly, ’2′ for weekly, ’1′ for daily
Optional parameters:
user: ‘user-name’ for user stats
Examples:
Channel activity graph this month: bargraphs.php?&mode=chan&chan=%23denora&type=3
User network activity this week: bargraphs.php?&mode=user&user=homer&chan=global&type=2
User activity on a channel today: bargraphs.php?&mode=user&user=homer&chan=%23denora&type=1
2.3 Network graphs (graphs.php)
——————
Needed parameters:
mode: ‘users’, ‘channels’ or ‘servers’
Optional parameters:
sy: start year (4 digits)
sm: start month (1-2 digits)
sd: start day (1-2 digits)
ey: stop year (4 digits)
em: stop month (1-2 digits)
ed: stop day (1-2 digits)
Any non-specified parameter will be replaced by the current date values.
Examples:
Server graph of today: graphs.php?mode=servers
User graph from 10/01/2005 until today: graphs.php?mode=users&sy=2005&sm=10&sd=1
Channel graph from 09/01/2005 to 12/31/2005: graphs.php?mode=channels&sy=2005&sm=9&sd=1&ey=2005&em=12&ed=31
Suggestion:
To display a graph containing the « last month » data, you can do the following (assuming you have php):
$start_date = explode(« / »,strftime(‘%m/%d/%Y’,strtotime(« -1 month »))); // This gets the date 1 month back from now
echo « « ;
?>
2.4 Additional parameters
————————-
Each of the graphs supports two additional parameters: ‘theme’ and ‘lang’.
This will affect language and colors of the graph.
Example:
http://stats.denorastats.org/libs/phpdenora/graphs/pie.php?theme=classic&lang=de&mode=version&chan=%23denora

