org.guifications.plugins: 37672bae9f8cecba73b96253f68ab30b2078e18c
nosnilmot at guifications.org
nosnilmot at guifications.org
Sat Oct 27 11:00:07 CDT 2007
-----------------------------------------------------------------
Revision: 37672bae9f8cecba73b96253f68ab30b2078e18c
Ancestor: 3b1a1980be0658f32ed8b78f2163f333b7bbc552
Author: nosnilmot at guifications.org
Date: 2007-10-27T15:56:49
Branch: org.guifications.plugins
Modified files:
eight_ball/eight_ball.c
ChangeLog:
Add /bollocks command, ported from /dev/bollocks kernel module (!) -
http://www.fatsquirrel.org/veghead/software/bollocks/
-----------------------------------------------------------------
This revision's diffstat output:
eight_ball.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 207 insertions(+), 3 deletions(-)
-------------- next part --------------
============================================================
--- eight_ball/eight_ball.c b5dba1fbaee2faf2f410775286ac99b4548f8317
+++ eight_ball/eight_ball.c 7a919f80738fd5a6f68006a24508c00276f19003
@@ -66,10 +66,196 @@ static const gchar *fullcrap_strings[] =
"dont sent any message any more stupit n idiot"
};
+#define MAXCRAPLEN 25
+#define BOLLOCKS_SIZE 1024
+
+static const char verbs[][MAXCRAPLEN]={
+ "aggregate",
+ "architect",
+ "benchmark",
+ "brand",
+ "cultivate",
+ "deliver",
+ "deploy",
+ "disintermediate",
+ "drive",
+ "e-enable",
+ "embrace",
+ "empower",
+ "enable",
+ "engage",
+ "engineer",
+ "enhance",
+ "envisioneer",
+ "evolve",
+ "expedite",
+ "exploit",
+ "extend",
+ "facilitate",
+ "generate",
+ "grow",
+ "harness",
+ "implement",
+ "incentivize",
+ "incubate",
+ "innovate",
+ "integrate",
+ "iterate",
+ "leverage",
+ "maximize",
+ "mesh",
+ "monetize",
+ "morph",
+ "optimize",
+ "orchestrate",
+ "reintermediate",
+ "reinvent",
+ "repurpose",
+ "revolutionize",
+ "scale",
+ "seize",
+ "strategize",
+ "streamline",
+ "syndicate",
+ "synergize",
+ "synthesize",
+ "target",
+ "transform",
+ "transition",
+ "unleash",
+ "utilize",
+ "visualize",
+ "whiteboard" }
+;
+
+static const char adjectives[][MAXCRAPLEN]= {
+ "24/365",
+ "24/7",
+ "B2B",
+ "B2C",
+ "back-end",
+ "best-of-breed",
+ "bleeding-edge",
+ "bricks-and-clicks",
+ "clicks-and-mortar",
+ "collaborative",
+ "compelling",
+ "cross-platform",
+ "cross-media",
+ "customized",
+ "cutting-edge",
+ "distributed",
+ "dot-com",
+ "dynamic",
+ "e-business",
+ "efficient",
+ "end-to-end",
+ "enterprise",
+ "extensible",
+ "frictionless",
+ "front-end",
+ "global",
+ "granular",
+ "holistic",
+ "impactful",
+ "innovative",
+ "integrated",
+ "interactive",
+ "intuitive",
+ "killer",
+ "leading-edge",
+ "magnetic",
+ "mission-critical",
+ "next-generation",
+ "one-to-one",
+ "open-source",
+ "out-of-the-box",
+ "plug-and-play",
+ "proactive",
+ "real-time",
+ "revolutionary",
+ "robust",
+ "scalable",
+ "seamless",
+ "sexy",
+ "sticky",
+ "strategic",
+ "synergistic",
+ "transparent",
+ "turn-key",
+ "ubiquitous",
+ "user-centric",
+ "value-added",
+ "vertical",
+ "viral",
+ "virtual",
+ "visionary",
+ "web-enabled",
+ "wireless",
+ "world-class"} ;
+
+static const char nouns[][MAXCRAPLEN]={
+ "action-items",
+ "applications",
+ "architectures",
+ "bandwidth",
+ "channels",
+ "communities",
+ "content",
+ "convergence",
+ "deliverables",
+ "e-business",
+ "e-commerce",
+ "e-markets",
+ "e-services",
+ "e-tailers",
+ "experiences",
+ "eyeballs",
+ "functionalities",
+ "infomediaries",
+ "infrastructures",
+ "initiatives",
+ "interfaces",
+ "markets",
+ "methodologies",
+ "metrics",
+ "mindshare",
+ "models",
+ "networks",
+ "niches",
+ "paradigms",
+ "partnerships",
+ "platforms",
+ "portals",
+ "relationships",
+ "ROI",
+ "synergies",
+ "web-readiness",
+ "schemas",
+ "solutions",
+ "supply-chains",
+ "systems",
+ "technologies",
+ "users",
+ "portals" };
+
+
static PurpleCmdId eight_ball_cmd_id = 0,
sg_ball_cmd_id = 0,
- fullcrap_cmd_id = 0;
+ fullcrap_cmd_id = 0,
+ bollocks_cmd_id = 0;
+static char *mkbollocks(void)
+{
+ int verb,adjective,noun;
+
+ verb = rand() % G_N_ELEMENTS(verbs);
+ adjective = (rand()+2) % G_N_ELEMENTS(adjectives);
+ noun = (rand()+69) % G_N_ELEMENTS(nouns);
+ return g_strdup_printf("%s %s %s\n", verbs[verb], adjectives[adjective], nouns[noun]);
+}
+
+
static PurpleCmdRet
eight_ball_cmd_func(PurpleConversation *conv, const gchar *cmd, gchar **args,
gchar *error, void *data)
@@ -91,6 +277,10 @@ eight_ball_cmd_func(PurpleConversation *
numstrings = sizeof(fullcrap_strings) / sizeof(fullcrap_strings[0]);
msgprefix = "The Purple Fullcrap Ball says";
msgs = fullcrap_strings;
+ } else if(!strcmp(cmd, "bollocks")) {
+ numstrings = -1;
+ msgprefix = "/dev/bollocks says";
+ msgs = NULL;
} else {
numstrings = sizeof(eight_ball_strings) / sizeof(eight_ball_strings[0]);
msgprefix = "The Purple 8 Ball says";
@@ -108,7 +298,12 @@ eight_ball_cmd_func(PurpleConversation *
if(index > numstrings)
index %= numstrings;
- g_string_append_printf(msgstr, "%s: %s", msgprefix, msgs[index]);
+ if (!strcmp(cmd, "bollocks")) {
+ char *tmp = mkbollocks();
+ g_string_append_printf(msgstr, "%s: %s", msgprefix, tmp);
+ g_free(tmp);
+ } else
+ g_string_append_printf(msgstr, "%s: %s", msgprefix, msgs[index]);
switch(purple_conversation_get_type(conv)) {
case PURPLE_CONV_TYPE_IM:
@@ -130,11 +325,12 @@ plugin_load(PurplePlugin *plugin)
static gboolean
plugin_load(PurplePlugin *plugin)
{
- const gchar *eight_ball_help, *sg_ball_help, *fullcrap_help;
+ const gchar *eight_ball_help, *sg_ball_help, *fullcrap_help, *bollocks_help;
eight_ball_help = _("8ball: sends a random 8ball message");
sg_ball_help = _("sgball: sends a random Stargate Ball message");
fullcrap_help = _("fullcrap: sends random fooling blabber");
+ bollocks_help = _("bollocks: sends random middle-manager bollocks");
eight_ball_cmd_id = purple_cmd_register("8ball", "w", PURPLE_CMD_P_PLUGIN,
PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT |
@@ -154,6 +350,12 @@ plugin_load(PurplePlugin *plugin)
PURPLE_CMD_FUNC(eight_ball_cmd_func),
fullcrap_help, NULL);
+ bollocks_cmd_id = purple_cmd_register("bollocks", "w", PURPLE_CMD_P_PLUGIN,
+ PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT |
+ PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, NULL,
+ PURPLE_CMD_FUNC(eight_ball_cmd_func),
+ bollocks_help, NULL);
+
return TRUE;
}
@@ -162,6 +364,8 @@ plugin_unload(PurplePlugin *plugin)
{
purple_cmd_unregister(eight_ball_cmd_id);
purple_cmd_unregister(sg_ball_cmd_id);
+ purple_cmd_unregister(fullcrap_cmd_id);
+ purple_cmd_unregister(bollocks_cmd_id);
return TRUE;
}
More information about the Plugins-commits
mailing list