time_t -> long long -> fs271
[xombrero.git] / marco.c
blob14cee0e80b627754715006a81bd4af7cb1569601
1 /* $xxxterm$ */
2 /*
3 * Copyright (c) 2011 Todd T. Fries <todd@fries.net>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <xxxterm.h>
20 static const char *message[] = {
21 "I fully support your right to put restrictions on how I can modify"
22 " or distribute something you created. Calling these restrictions "
23 "\"liberty,\" however, is just Orwellian doublespeak",
24 "GET OFF MY INTERNET LAWN!!!!",
25 "here is your list of restrictions -> freedom!!!!",
26 "i am all for it being free; i am all for not allowing abuse",
27 "webkit 1.4 is a huge step backwards",
28 "i honestly dont get how people equate gpl with liberty or freedom",
29 "I have no idea where you came up with the idea that you have to "
30 "continuously patch OpenBSD. Last time I cared about that was when "
31 "I was still dicking around with Linux.",
32 "Problem with discussion is that it doesn't add any code to cvs.",
33 "I can insult you some more but I am not sure you'd get it.",
34 "the mouse is for copy/paste and the interwebs",
35 "You could run openbsd and be done with it. Unlike linux is doesn't "
36 "suck so that helps that decision.",
37 "Twitter is the dumbest fucking thing that has ever happened to the Internet.",
38 "[speaking of {open,libre}office] it is an obese crack whore with herpes boils "
39 "that are about to explode"
42 const char *
43 marco_message(int *len)
45 const char *str;
47 str = message[arc4random_uniform(sizeof(message)/sizeof(message[0]))];
48 *len = strlen(str);
50 return str;
53 int
54 marco(struct tab *t, struct karg *args)
56 char *page, line[64 * 1024];
57 int len;
59 if (t == NULL)
60 show_oops(NULL, "marco invalid parameters");
62 line[0] = '\0';
63 snprintf(line, sizeof line, "%s", marco_message(&len));
65 page = get_html_page("Marco Sez...", line, "", 0);
67 load_webkit_string(t, page, XT_URI_ABOUT_MARCO);
68 g_free(page);
70 return (0);