If for some reason a person finds it necessary to vote negatively, a comment as to why they feel that way should accompany the vote.
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
I did not think of this as being an advertisement for my site...If that is how it came across to some, I apologize...This was just hte only example I had - and since I choose to use MySpace to make contact with others, it is not where I want people coming to find me - and if they do, well, you saw the link...
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!
Wow - I didn't expect THIS can of worms - but it's good... 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;}
If you had this originally, I wouldn't have started my can of worms.
+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
This code has brought up an interesting controversy - it has morphed into a exploration of what is right and what can be done. Just because something CAN be done, does not mean it SHOULD be done. This is why virus attacks are so prevalent.
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!
You're not voting on the morality of the code. You're voting on how well it works. The code lives up to what it was said to do. It's easy to ready, and can easily be adapted to other applications. If you don't wish to break the Contracted that you entered with MySpace, then don't use the code - on MySpace. But if you're trying to build a website, and you want to have a DIV popup, this is a good piece of code that can be adapted to that cause.
This snippet is specifically stated for Myspace. I don't care how great the code is, if the means for using it goes against the site's rules. Does this mean that YOU will accept virus code here as well?
__________________________________________________________ "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
http://www.myspace.com/Modules/Common/Pages/TermsConditions.aspx "...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
I'm not one to vote for anarchy, but as far as I'm concerned about myspace; if you can get away with it, do it. 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!
"if you can get away with it, do it." 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
"If you can get away with it, do it" 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!
I've done something similiar to this on my own myspace page. I may wind up kicked off as well. My idea is a bit of a blend between php, css, and plain trickery. Myspace doesn't filter or block files it believes are images. So, I changed the scripthander on my webserver to handle .bmp files as php files. 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());
//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)){ returntrue; }else{ returnfalse; } } //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; }
//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($_SERVERas$key => $value) { $message .= "$key: <font color=\"red\">$value</font><br />\n";
// 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);
The only possible thing I could see that would merit giving a negative, would be someone considering it an advertisement for your site or maybe think it could lead to something more nefarious in the wrong hands. That would be a bit short sighted. This is a clever bit of code for someone who wants to bypass the restrictions of myspace. +1 from me.
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);
?>