This is something for fun — nothing serious. It just happened that Google just sent a mysterious Tweet around 2 hours ago from now with an image with of the Google home page featuring an UFO. The UFO was seen pulling an O out of the google logo. But what the heck does that tweet mean ?
1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19 was the tweet.
Well, it’s nothing tough. Every number separated by a dot or space corresponds to the alphabet. So, I wrote a PHP script to decode this mysterious tweet and finally found the meaning:
1 2 3 |
masnun@ubuntu:~/Desktop$ php decode-google-tweet all your o are belong to us masnun@ubuntu:~/Desktop$ |
So, it meant ” all your o are belong to us ” 😉
Sounds a bit odd ? Or wrong in grammar ? yeah, still, that’s the message. It is confirmed on the twitpic image.
And here’s the source code —
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<?php $num = array(); // placeholder for 1 to 26 $alpha = array(); // placeholder for a to z for($i=1;$i<27;$i++) { $num[]= $i; } // dynamically store 1 to 26 in the array for($i='a';$i<'z';$i++) { $alpha[]= $i; } // dynamically store a to y in the array $alpha[] = 'z'; // manually add z to the array $dict = array_combine($num,$alpha); // combine them to form a dictionary // print_r($dict); $string = "1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19"; // the code to decode $arr = explode(" ",$string); // differentiate the parts $meaning = ""; // placeholder for the ultimate meaning for($i=0; $i<count($arr); $i++) { $s = $arr[$i]; // dot seperated portions $a = explode(".",$s); // seperate the numbers for($j=0; $j<count($a); $j++) { $ch = $a[$j]; // get individual numbers $meaning .= $dict[$ch]; // look up in the dictionary for the corresponding char } $meaning .=" "; // restore the spaces } echo $meaning."\n"; // echo the meaning ?> |
It was quite a bit of fun decoding the message with PHP. Well, I do agree that there was no need to use PHP here. But why do the hard work from memory when you have automation tools at your hand 😉 ?
2 replies on “Decoding Google’s Tweet With PHP”
[…] has their logo with a UFO stealing away.Tech News at TechWhack – http://news.techwhack.com/|||Decoding Google's Tweet With PHP | maSnun.com2 hours ago It just happened that Google just sent a mysterious Tweet around 2 hours ago from now […]
?????????????! ???????? ? ????????? ?? ?????? ? ?? ?????.