API 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. With the advent of the modules, an API becomes necessary. This
  2. file is the place to document anything along those lines.
  3. The main parts of pisg operate by passing around a %stats hash. That
  4. hash is pretty big:
  5. Key Type Index Description
  6. --------------------------------------------------------------------------
  7. words hash <nick> Number of words typed by given nick.
  8. wordcounts hash <word> Number of times given word was used.
  9. wordnicks hash <word> The last nick to use the given word.
  10. times hash <hour> Number of lines typed in the channel during
  11. the given hour (0..23).
  12. lines hash <nick> Number of lines typed by the given nick (both
  13. "normal" and action lines).
  14. line_times hash <nick> $line_times{nick}[index] index ranges from
  15. 0 to 3 and contains a count of the number of
  16. lines typed by that nick in the given time
  17. period. Each index is a 6-hour block.
  18. (e.g. 3 is from 18:00 to 23:59.)
  19. monologues hash <nick> Number of times the given nick had a
  20. monologue.
  21. sayings hash <nick> Random normal line from the given nick.
  22. questions hash <nick> Number of lines from the given nick that
  23. ended in question marks.
  24. shouts hash <nick> Number of lines ending in exclamation points.
  25. allcaps hash <nick> Number of lines in ALL CAPS.
  26. allcaplines hash <nick> Random line containing ALL CAPS.
  27. foul hash <nick> Number of lines containing foul words.
  28. foullines hash <nick> Lines containing foul words.
  29. smiles hash <nick> Number of lines containing smiling faces.
  30. frowns hash <nick> Number of lines containing sad faces.
  31. urlcounts hash <url> Number of times each URL was mentioned.
  32. urlnicks hash <url> Last nick to mention each URL.
  33. lengths hash <nick> Total length of all lines from the given
  34. nick.
  35. actions hash <nick> Number of actions.
  36. actionlines hash <nick> Random action line.
  37. violence hash <nick> Number of times the given nick attacked
  38. someone else.
  39. violencelines hash <nick> Random example of the given nick attacking
  40. someone.
  41. attacked hash <nick> Number of times the given nick was attacked.
  42. attackedlines hash <nick> Ramdom example of the given nick being
  43. attacked.
  44. gaveops hash <nick> Number of times the given nick granted ops.
  45. tookops hash <nick> Number of times the given nick removed ops.
  46. gavevoice hash <nick> Number of times the given nick granted voice.
  47. tookvoice hash <nick> Number of times the given nick removed voice.
  48. kicked hash <nick> Number of times the given nick kicked
  49. someone.
  50. gotkicked hash <nick> Number of times the give nick was kicked.
  51. kicklines hash <nick> Random example of the given nick being
  52. kicked.
  53. joins hash <nick> Number of times the given nick joined the
  54. channel.
  55. topics array Each array element is a hash with the
  56. following indices:
  57. topic - The new channel topic.
  58. nick - The person who set the topic.
  59. hour - The hour in which the change took
  60. place.
  61. min - The minute in which the change took
  62. place.
  63. days scalar Number of days the reporting period spanned.
  64. totallines scalar Total number of lines seen in file(s).
  65. parsedlines scalar Total number of parseable lines (normal,
  66. action, and third) seen in channel.
  67. processtime hash A hash containing 'hours', 'mins' and 'secs',
  68. describing the time elapsed while processing
  69. this channel.
  70. nicks hash A hash containing all nicks a user had through
  71. a logfile. The keys are the nicks, and the values
  72. is an array with their alternative nicknames.