Advertisement
Chuso

SEO friendly StrikeTools to blackout a PHP site against SOPA

Jan 18th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.89 KB | None | 0 0
  1. <?php
  2.   // PHP:  Coded by Jesus Perez (Chuso) <http://chuso.net>
  3.   //                                    Twitter:   @chusop
  4.   //                                    Identi.ca: @chuso
  5.   //                                    Diaspora*: chuso@joindiaspora.com
  6.   // HTML: "Borrowed" from http://protestsopa.org/
  7.  
  8.   // Add this to your .htaccess file:
  9.   // php_value auto_prepend_file sopa.php
  10.   // replacing sopa.php by the name you save this file as
  11.  
  12.   // Configure blackout start and end time
  13.   $bl_start = array(
  14.     "year"   => 2012,
  15.     "month"  => 1,
  16.     "day"    => 18,
  17.     "hour"   => 8,
  18.     "minute" => 0,
  19.     "second" => 0
  20.   );
  21.   $bl_end = array(
  22.     "year"   => 2012,
  23.     "month"  => 1,
  24.     "day"    => 18,
  25.     "hour"   => 20,
  26.     "minute" => 0,
  27.     "second" => 0
  28.   );
  29.   // End of configuration
  30.  
  31.   $start_time = mktime($bl_start["hour"], $bl_start["minute"], $bl_start["second"], $bl_start["month"], $bl_start["day"], $bl_start["year"]);
  32.   $end_time = mktime($bl_end["hour"], $bl_end["minute"], $bl_end["second"], $bl_end["month"], $bl_end["day"], $bl_end["year"]);
  33.  
  34.   if ((time() >= $start_time) && (time() < $end_time))
  35.   {
  36.     header("HTTP/1.1 593 On strike agians SOPA & PIPA");
  37.     header("Status: 593 On strike agians SOPA & PIPA");
  38.   ?>
  39.     <html><head><title>Save the Internet. Act now.</title> <link href='http://fonts.googleapis.com/css?family=Six+Caps' rel='stylesheet' type='text/css'><link href='http://fonts.googleapis.com/css?family=Stint+Ultra+Condensed' rel='stylesheet' type='text/css'><style>
  40.     body {
  41.       color: #fff;
  42.       font-size: 88px;
  43.       margin: 50px auto;
  44.       text-align:center;
  45.       width:800px;
  46.       background: #121110 url(darth_stripe_sm.png) repeat;
  47.     }
  48.  
  49.     p {
  50.       padding:0;
  51.       margin:1em 0;  
  52.       font-size:18px;
  53.       font-family: 'Arial';
  54.       letter-spacing:3px;
  55.       line-height: 1em;
  56.     }
  57.  
  58.     a {
  59.       text-decoration: none;
  60.       color:#bb7711;
  61.     }
  62.  
  63.     a:hover {
  64.       color:#bb5500;
  65.     }
  66.  
  67.     .bills{
  68.       text-decoration:underline;
  69.       color:white;
  70.       letter-spacing:0px;
  71.     }
  72.  
  73.     .act{
  74.       font-family: 'Stint Ultra Condensed';
  75.       font-size:218px;
  76.       padding:0;
  77.       margin:0;
  78.       letter-spacing:5px;
  79.     }
  80.     .save{
  81.       font-family: 'Stint Ultra Condensed';
  82.       font-size:108px;
  83.       padding:0;
  84.       margin:0;
  85.       letter-spacing:5px;
  86.     }
  87.  
  88.     .link{
  89.       color: #FFC273;
  90.       letter-spacing:0;
  91.       padding: 2em;
  92.       line-height: 2em;
  93.     }
  94.  
  95.     .orange a:hover {
  96.     }
  97.     </style> </head><body><div><hr><p class="save">SAVE THE INTERNET.</p><p>This site has been taken down in protest of bills currently being considered in the US House and Senate. Called <a class="bills" href="http://thomas.loc.gov/cgi-bin/bdquery/z?d112:h.r.3261:">SOPA</a> and <a class="bills" href="http://www.opencongress.org/bill/112-s968/show">PIPA</a>,<br />these bills threaten to destroy the Internet as we know it.</p><p>If either one passes, your favorite sites could disappear forever.</p><hr><a href="http://americancensorship.org/modal/call-form-moz.html"><p class="act">ACT NOW.</p></a><p><span><a class="link" href="http://americancensorship.org/modal/call-form-moz.html">CALL YOUR SENATOR AND ASK THEM TO VOTE "NO" FOR PIPA</a></span> <span><a class="link" href="https://github.com/SaraJo/SOPA-PIPA-Protest-Page">JOIN US</a></p><div></body><script type="text/javascript"> var _gaq = _gaq || [];
  98.       _gaq.push(['_setAccount', 'UA-28424226-1']);
  99.       _gaq.push(['_trackPageview']);
  100.  
  101.       (function() {
  102.         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  103.         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  104.         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  105.       })();
  106.  
  107.     </script> </html>
  108.   <?php
  109.     exit();
  110.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement