Great MySpace Coverup...
8
This one may get me in trouble or kicked off MySpace altogether, but I thought it would be a fun bit of CSS magic to post.
As some of you may already know, MySpace does a REALLY good job of preventing images, script and some other tags from being used to customize your space. They have even gone to the extent of using tables without ID's to do the layout.
Pretty ingenious, allowing some customization, but still keeping those annoying ads for single women available to me and my youth groups kids, my family, etc..
Well no more - I want my friends to visit My Site, not just MySpace - so I have a clever method of getting them to go there, instead of posting comments on MySpace...
Check out my space to see this code in action!
www.myspace.com/casper619
As some of you may already know, MySpace does a REALLY good job of preventing images, script and some other tags from being used to customize your space. They have even gone to the extent of using tables without ID's to do the layout.
Pretty ingenious, allowing some customization, but still keeping those annoying ads for single women available to me and my youth groups kids, my family, etc..
Well no more - I want my friends to visit My Site, not just MySpace - so I have a clever method of getting them to go there, instead of posting comments on MySpace...
Check out my space to see this code in action!
www.myspace.com/casper619
<style>
body {overflow: hidden;}
table * {height: 0;}
select {display: none;}
a * {text-decoration: none;}
</style>
<div id="MySpaceOverlay" style="
background: url(http://www.edmistons.com/templates/Edmistons%20v2006.10/images/pageBG.png) bottom repeat-x;
_background: url(http://www.edmistons.com/templates/Edmistons%20v2006.10/images/pageBG.png) top repeat-x;
top: 0;
left: 0;
height: 100%;
_height:10000px;
width: 100%;
_width:10000px;
padding: 0px;
display: block;
position: absolute;
">
<div id="MySun" style="
background: url('http://www.edmistons.com/templates/Edmistons v2006.10/images/sun.png');
_background: url(http://www.edmistons.com/templates/Edmistons v2006.10/images/sun.gif);
top: 0;
left: 0;
height: 125px;
width: 125px;
position: absolute;
">
</div>
<div id="MySpaceWarning" style="
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image src='http://www.jeremyedmiston.com/fonts/font.php?text=You should not be on MySpace!&font=Soopafresh.ttf&size=24&color=cc6600&transparent=true&outcolor=ffcc00&outwidth=1&outline=true');
background: url('http://www.jeremyedmiston.com/fonts/font.php?text=You should not be on MySpace!&font=Soopafresh.ttf&size=24&color=cc6600&transparent=true&outcolor=ffcc00&outwidth=1&outline=true')top left no-repeat;
width: 500px;
height: 40px;
display: block;
position: relative;
margin-left: 130px;
margin-bottom: 10px;
">
</div>
<a id="GetFlock" href="http://downloads.flock.com/index.php?os=win&product=flock-0.7.8&utm_source=flockcom&utm_medium=homepage&utm_campaign=flockcom002&utm_content=os_language" title="(You should not be using Internet Explorer either!!)" >
<div id="FlockYou" style="
display:none;
_display: inline;
background: url(http://spread.flock.com/buttons/getFlock-EN.gif) top right no-repeat;
top: 2px;
left: 630px;
width: 260px;
height: 30px;
cursor: pointer;
position: absolute;
padding-right: 90px;
padding-top: 2px;
text-decoration: none;
">You should not be using Internet Explorer either!!
</div>
</a>
<div id="Photo" style="
background: url('http://www.edmistons.com/images/stories/photoalbum/Bed%20time%20devotions/images/cimg1952.jpg');
width: 640px;
height: 480px;
border: 5px solid #FFFFFF;
margin-left: 130px;
">
</div>
<div id="Grass" style="
background: url(http://www.edmistons.com/templates/Edmistons%20v2006.10/images/grassBG.png) repeat-x bottom;
bottom: 40px;
width: 100%;
height:60px;
position: absolute;
_display: none;
">
<a id="MySiteLink" href="http://www.edmistons.com">
<div id="MySiteText" style="
background: url('http://www.jeremyedmiston.com/fonts/font.php?text=Visit me and my family at www.edmistons.com...&font=Soopafresh.ttf&size=24&color=cc6600&transparent=true&outcolor=ffcc00&outwidth=1&outline=true')top left no-repeat;
margin-top: 15px;
width: 760px;
height: 50px;
display: block;
_display: none;
position: relative;
margin-left: 130px;
">
</div>
</a>
</div>
<div id="GroundCover" style="
background: #669900;
bottom: 0px;
width: 100%;
height:40px;
position: absolute;
_display: none;
">
</div>
<div id="IEGrass" style="
background: url(http://www.edmistons.com/templates/Edmistons%20v2006.10/images/grassBG.gif) repeat-x bottom;
width: 100%;
height:60px;
position: relative;
margin-top: -10px;
display: none;
_display: block;
">
</div>
<a id="IEMySiteLink" href="http://www.edmistons.com">
<div id="MySiteText" style="
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image src='http://www.jeremyedmiston.com/fonts/font.php?text=Visit me and my family at www.edmistons.com...&font=Soopafresh.ttf&size=24&color=cc6600&transparent=true&outcolor=ffcc00&outwidth=1&outline=true');
margin-top: 15px;
width: 760px;
height: 50px;
display: none;
_display: block;
position: relative;
margin-left: 130px;
margin-top: -50px;
">
</div>
</a>
<div id="IEGroundCover" style="
background: #5a8f00;
width: 100%;
height:4000px;
position: relative;
display: none;
_display: block;
">
</div>
</div>






This community provides a means to share code with other programmers (or some script kiddies in most cases) and should be used to help promote solid code. If it is a simple "I don't like this" then don't do anything - if there is syntactic or semantic errors or a dieeferent way to do things, then yes, I could see the need for a negative comment.
It is helpful for the person submitting code to have peers look at code, review and give constructive criticism. A simple negative vote does none of the above, but make newbies who either don't understand what is going on, or hotshots that do not really code for a living look silly.
I would like to see this as a policy for submitting a negative vote. I sure don't mind getting negative votes, but please, let me know if I have written bad code, too many errors or if there is a simpler way of doing things.
Thank you,
Jeremy Edmiston
Programmer/Analyst
Point Loma Nazarene University
Thanks again, it is the quick moment that it takes to write a comment that helps us out with our code and/or motives behind the code!
~Jeremy
Anyways, I updated one line and that keeps me ok with TOS - and still allows people to view my REAL MySpace Page... View the code below - and take a look at the site now and post your feedback.
This was not an attempt at malicious defacing, just showing the power of CSS mostly...
body {padding-top: 100%;overflow: hidden; overflow-y: auto;}
table {height: 0;}
+1 on code now...
__________________________________________________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
My intention was not to violate terms, however, I knew that I was as stated in my comment prefacing this snippet. After reviewing the comments and my reasoning for the 'hack', I realized that I was setting a poor example ethically by what I was doing.
In an effort to block immoral content from people who really shouldn't be on MySapce to begin with, I had committed an immoral act by blatantly violating terms to which I agreed. The ends do not justify the means in this case, as is true with most of what is done with technology.
I would urge all who read this and who spend time working with code, please understand the potential of your creation. Not only does the code we produce reflect our understanding and manipulation of technology, it also reflects the type of person one is. As for me and my code, I want only the best in my character to show through.
Thank you all for the comments on this subject, I will leave you with your own morality to decide how your code is used.
~Jeremy
I sense a conciliatory tone in your response to criticism made to your code snippet. While I disagree with your reasons for extending the functionality of your myspace profile (an argument not suited for this forum), I (as do others) appreciate your effort to show what's possible with only CSS.
Thank you
Really
______________________________________________________
Yogurt? I hate yogurt! Even with strawberries!
+1 vote for me.
__________________________________________________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
"...Prohibited activity includes, but is not limited to: ..."
"...covering or obscuring the banner advertisements on your personal profile page, or any MySpace.com page via HTML/CSS or any other means;..."
They even have a statement about it when you are editing your profile:
"You may enter HTML/DHTML or CSS in any text field. Javascript is not allowed. Do not use HTML/CSS to cover MySpace advertisements."
Simply, if you don't like how MySpace operates, then don't get an account. As being a member of their website, you agreed to THEIR terms and conditions.
/end of common sense and -1 vote for me.
__________________________________________________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
If Jeremy was blocking myspace ads so he could run an e-commerce site off of myspace servers, he would be a bastard. But he's not doing that. This code is clever as hell, and you're being Debby-Downer
No offense, but lighten up a bit.
______________________________________________________
Yogurt? I hate yogurt! Even with strawberries!
Ok, I could get away with murder...so, that makes it right? I don't understand the difference. Why is it ok if the website is just Myspace? Their rules don't apply to anyone? Ok sure, they might apply to others, but not 'me.' Amazing, I want some of this logic at work!
"you're being Debby-Downer" Yep, people can't handle the truth nowadays...
__________________________________________________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
I think you may have taken my comment out of context. Myspace is an extendable social-networking site. It was made that way so that people could customize their profile pages with their own style and "flair". It just so happens that my style and flair involves my own version of making my profile private (kinda). My code in no way blocks Myspace advertisements, and I don't advocate doing so. I failed to make my point clear, and for that I apologize.
"If you can 'legally' get away with it, do it."
All rules are made for "bending" and interpretation. If you're not trying to see the limits of the TOS, then you're not trying to make the most of what's possible. To me, that sounds like mediocre programming induced by fear of reprisal. If you're afraid to make interesting programs, don't scorn those who aren't.
"You wan't the truth? YOU CANT HANDLE THE TRUTH!"
______________________________________________________
Yogurt? I hate yogurt! Even with strawberries!
Next, I added a small div item with absolute positioning in my profile with an image linking to http://corycollier.com/images/myspace.bmp
Finally, the bitmap is a script that runs a bunch of stuff. If the user doesn't authenticate, they get a 1,000 x 10,000 image that covers the screen. If they DO authenticate, it's just a 1x1 image.
Eitherway, I get an e-mail alert, I log all header info in to a mysql database, and compare that info with known ip addresses to find out WHO is looking at my page.
Attached is a copy of the myspace.bmp file
______________________________________________________
Yogurt? I hate yogurt! Even with strawberries!
<?php
// Database connection variables
$host = ""; //Sorry, but I'm not handing that out.
$user = "";
$pw = "";
$db = "";
// Link to database server, or error out.
$link = mysql_connect($host, $user, $pw);
if (! $link)
{
die("Couldn't connect to MySQL");
}
//Select the database previously defined as $db
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
// Collect Information
$int_timestamp = date("U");
$str_ip = $_SERVER['REMOTE_ADDR'];
$str_useragent = $_SERVER['HTTP_USER_AGENT'];
$str_referrer = $_SERVER['HTTP_REFERER'];
//Function for validating username and password
function cc_validate($user, $pass) {
$users = array('the_right_username' => 'the_right_password');
if(isset($users[$user]) && ($users[$user] == $pass)) {
return true;
} else {
return false;
}
}
//Check if username and password are valid.
//NOTE: This is a spoof. I can't really control who looks at my site.
//However it is interesting to see what people will use as a username and password
if(! cc_validate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="My Website"');
header('HTTP/1.0 401 Not Authorized');
$bool_notcool = true;
}
//Insert info into database
$sql = "INSERT INTO pageviews(int_timestamp, str_useragent, str_ip, str_referrer, str_uname, str_pword) VALUES('$int_timestamp', '$str_useragent', '$str_ip', '$str_referrer', '" . $_SERVER['PHP_AUTH_USER'] . "', '" . $_SERVER['PHP_AUTH_PW'] . "')";
$result = mysql_query($sql);
//The next part is to determine by IP Address, if the user is known
$show_greeting = false;
$sql2 = "SELECT person FROM known_ips WHERE ip='$str_ip'";
$result2 = mysql_query($sql2);
//If there is a valid result, the user is known (unless there's more than one person looking at my myspace page from the same ip address)
if($result2) //We have a winner!
{
$row2 = mysql_fetch_array($result2);
$str_greeting1 = "Hello " . $row2['person'];
$str_person = $row2['person'];
$show_greeting = true;
}
//Mail a notification
$to = ""; //I'm not handing that out either
$subject = "Myspace viewing alert : $str_person";
$message = "<h1>$str_person was checking out your myspace page</h1>\n";
foreach($_SERVER as $key => $value)
{
$message .= "$key: <font color=\"red\">$value</font><br />\n";
}
$headers = "From: example.com\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
// Send
mail($to, $subject, $message, $headers);
// create an image based on authentication, and whether the ip address is from a known ip address
if(!$bool_notcool)
{
//If the user isn't previously known, just create a 1x1 image
if(!$show_greeting)
{
$im = imagecreate(1, 1);
}
//If the user IS known, create a 200x30 image welcoming them
else
{
$im = imagecreate(200,30);
$bg = imagecolorallocate($im, 0, 0, 0);
$textcolor = imagecolorallocate($im, 0, 255, 0);
imagestring($im, 5, 0, 0, $str_greeting1, $textcolor);
}
}
else
//If the user fails to authenticate, make life tough on them!
{
$im = imagecreate(1280, 10280);
}
// black background and green text
$bg = imagecolorallocate($im, 0, 0, 0);
$textcolor = imagecolorallocate($im, 0, 255, 0);
$str_tell = "When you log in to my site, then you can see everything. Until then, FUCK YOU!";
imagestring($im, 5, 0, 500, $str_tell, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>